Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding string in TXT file
Message
From
24/12/2022 17:15:16
 
 
To
24/12/2022 15:23:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01685605
Message ID:
01685607
Views:
58
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform