Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding string in TXT file
Message
De
24/12/2022 17:15:16
 
 
À
24/12/2022 15:23:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01685605
Message ID:
01685607
Vues:
59
>Any ideas how to find string between two unique strings in TXT file without using FILETOSTR command?
>For example I need to find string
>
>aa
>bb
>cc
>
>in TXT file
>
>1111
>2222
>3333
>first string:aa
>bb
>cc
>second string:fsdfsdfs
>444
>555

Why can you not use FILETOSTR()? It's probably the simplest.

If the maximum length of a line is less than 254, you could import into a cursor and process that:
CREATE CURSOR _Strings ( CharStr C( {max string length} ) )
APPEND FROM {YourTextFile} TYPE SDF
LOCATE FOR LEFT( CharStr, LEN( {first string} ) ) == {first string}
etc.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform