[Gambas-user] File read question LineInput Question

Ron_1st ronstk at ...239...
Sun Dec 7 12:33:32 CET 2008


On Sunday 07 December 2008, richard terry wrote:
> I have files, could be thousands of lines, but the start/end lines are like 
> this:
> 
> 
FHS|^~\&|APOLLO|NATA^2178^N|||200811101339+1100||dhm0003.ORU||3
> 
> 
> FTS|1|3
> 

> 
> I wondered what the rectangle represents I guess must be some sort of byte 
> count??, and how to get rid of it as I process the file.
> 
> My code to read the file which works fine is:
> 
>      hfile = Open sFilename For Input 
>   
>       While Not Eof(hfile)                              
>              Line Input #hfile, OneLine        
> 
>           
> Thanks in anticipation.
> 
> richard
> 

many programs write to there files some magis header for identification.
In *.gif files you can see GIF98, *.jpeg uses JIFF as readable text.
They can also use a byte(s) like FBF9 im some *.mpg files.

Here the block is a character not available as visual glyph for screen in
your current font.

I asume the file(s) is/are longer as 256 bytes so the need 2 bytes for length.
Using 'khexedit' (KDE) you can see if all those files start with the same byte.
The last square in your example can be part of a CR/LF or a close marker.

Without some of those files and/or know what program made them it is not 
easy to see the logic and do a absolute statement but I think my gues is right.


Best regards
Ron_1st




More information about the User mailing list