Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to tell a binary from a text file?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00464420
Message ID:
00464813
Views:
28
>Is there a way to read a file type? i.e if I expect to receive coma delimited files and get a spreadsheet instead, is there anyway to tell?

If you know something about the ascii file, you make a quick check.

For example, if you know there is a comma delimited with 6 fields per record, you can just read the first line and look if it has 5 commas. It is not a bulletproof method, but it's a start.

Also, you can try to find some pattern in the first bytes of an Excell spreadsheet, although except that you find some documentation stating that this is standard, I'll use this with care. It can work just for some type of spreadsheet, an speceific version, etc. It all depends on the level of research you have time to do.

Hope this helps.
Previous
Reply
Map
View

Click here to load this message in the networking platform