Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching Text Files
Message
 
 
To
21/11/2000 14:43:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00444315
Message ID:
00444325
Views:
9
>Is there any way to do a search in a text file for a particulary character? The only way I have been able to do this is to use FSEEK() and FREAD() to read each character. It is extremely slow on large text files.
How many bytes do you read at a time using FREAD()? As Fred & Trey have suggested FILETOSTR() might be your best bet:

cFileContent = FILETOSTR( "MyFile.Txt" )
iTotalInstances = OCCURS( CHR( iMyChar ), cFileContent ) && this is case sentitive.
iPosOfFirstInstance = AT( CHR( iMyChar ), cFileContent ))
*- Or if you want to ignore case:
iPosOfFirstInstance = ATC( CHR( iMyChar ), cFileContent ))
censored.
Previous
Reply
Map
View

Click here to load this message in the networking platform