Click to See Complete Forum and Search --> : removing heders of the file


rtos
March 17th, 2005, 06:13 PM
Is there any way to remove the headers of one file .

I need to remove the headers .

for example :

00001 0xdfsd 0xrwe 0xdfg 0xds
00002 0xdfdf 0xddf 0xdfd 0xfdf
00003 0xdas 0xfsdf 0xdfd 0xfdf
...
...
00001 ,00002 etc are the headers of the file.

When i read using fread () how to remove the headers only?

gstercken
March 17th, 2005, 06:22 PM
When i read using fread () how to remove the headers only?What do you mean by 'remove'? Do you just want to read the file, but ignore the header? Or do you need to write the file back without the header?

gstercken
March 17th, 2005, 06:25 PM
00001 0xdfsd 0xrwe 0xdfg 0xds
00002 0xdfdf 0xddf 0xdfd 0xfdf
00003 0xdas 0xfsdf 0xdfd 0xfdfStrange... Are that the literal contents of the file? Or are those supposed to be hex numbers (as the 0x prefix suggests)? If yes, what are characters like 'r', 'w' and 's' doing there? :confused:

rtos
March 17th, 2005, 06:26 PM
I want to write the file to another file without header .
The file is quite big .
So ,how to write the data only to another file without header?

gstercken
March 17th, 2005, 06:39 PM
I want to write the file to another file without header .
The file is quite big .
So ,how to write the data only to another file without header?The only straightforward way is to read your file into memory (either entirely or in chunks) and write it back to the new file, starting after the header data. How the end of the header can be found depends on how it is organized - it might have a fixed size (easy) or be structured, so you would need a way to interpret it and find out where it ends.

rtos
March 17th, 2005, 06:56 PM
thanks i got the idea now.
i will try it now.