Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Searching Text Files
Message
 
 
À
21/11/2000 14:43:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00444315
Message ID:
00444325
Vues:
13
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform