Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing long text
Message
De
15/01/2013 17:48:06
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01562861
Message ID:
01562862
Vues:
102
This message has been marked as the solution to the initial question of the thread.
>I have a long text that i want to shorten to another text file mytext.txt TO mytext2.txt (short version)
>i would like to remove everything before the symbol >>__________ below in mytext2
>
>so in brief:
>mytext.txt is complete, mytext2.txt shows everything AFTER the '>>__________' symbol that appears in mytext.txt
>
>any suggestions on the shortest possible route to do this would be appreciated.


If you always know your search string will be in there, maybe something like:
lcFullData  = filetostr("mytext.txt")
lcNeedle    = ">>__________"
lcShortData = right(lcFullData, LEN(lcFullData) - AT(lcNeedle, lcFullData) - LEN(lcNeedle))
strtofile(lcShortData, "mytext2.txt")
??

You could shorten it slightly, but I think it might be harder to read/follow:
lcFullData  = filetostr("mytext.txt")
strtofile(right(lcFullData, LEN(lcFullData) - AT(">>__________", lcFullData) - LEN(">>__________")), "mytext2.txt")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform