Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FGETS() to know if linefeed
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00687804
Message ID:
00687825
Views:
12
Charles,

You can use the hexedit.app file that sits under the \vfp\tools folder to open the file and see exactly what characters are in the file.

You can also simply ignore the lines that are not long enough:
do while ! feof( fh )
   lcLine = fgets( fh )
   if ( len( lcLine ) > 0 )
      * process the line
   endif
enddo
>I have a text file that I open and read data from. The problem is that its format is not in a form of a dellimited text file. Its kind of a report that is exported to a text file. Though this is the case, I have found that fields are in a fixed-width. So , I try to FGETS() each line, get the string data from it, count the fixed-width characters I need and do some processing. But some lines, FGETS() returns empty twice or thrice (but if text file is opened in say notepad.exe, actual line only has spaces in them). Could it be that those "spaces" are linefeeds or carriage returns? But when I try to see if they are, FREAD() returns CHR(32). I need to just scan all the lines in a text file, from the return value get n characters from it. Each "detail record" I know for sure is x lines, but between each "detail record" I dont know how many "spaces"/linefeeds/carriage returns. Any help would do, thanks!
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform