Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String Function Help
Message
 
 
À
12/04/2003 05:15:07
Liam O'Hagan
O'Hagan Programming Ltd
Irlande
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00776874
Message ID:
00776926
Vues:
13
Thanks for the info. Two little details that I could probably work out, but would love a bit of help. The string is in a 3k file. I was going FGETS, but the data could fall over more than a single line of data. It would certainly be easier to work with the file as if it were a string ... is that possible? Also, the text labels (Subdivision:, etc) are not necessarily next to each other. There can be garbage between them. The text data ends with a HTML & + nbsp. I typed that character into my original question, but the UT removed it.

Thanks

Brenda


>The trick with variable length substrings like this is to start at the end >and work your way backwards. Example code below...
>
>
>Local laSearch(6,2)
>
laSearch(1,1) = "Subdivision:"
laSearch(2,1) = "Range:"
laSearch(3,1) = "Defendant(s):"
laSearch(4,1) = "Township:"
laSearch(5,1) = "Section:"
laSearch(6,1) = "Plaintiff(s):"
>
For lnCounter = 1 To Alen(laSearch,1)
laSearch(lnCounter,2) = Extract(@lcTheString, laSearch(lnCounter,1))
? laSearch(lnCounter,2)
EndFor
>
Function Extract(lcTheString, lcSearchedFor)
Local lcResult

lcResult = Substr(lcTheString, At(lcSearchedFor, lcTheString))
lcTheString = Substr(lcTheString, 1, At(lcSearchedFor, lcTheString)- Return lcResult
EndFunc
>


>>I need some string help. I am downloading a web page a local file and then writing a small program to pull the data from it. The HTML code is striped and all I have left are the text labels, the data, and the ending . I want everything between the text labels and the ending .
>>
>>An example is below. The text labels are always the same, and always in the same order - "Plaintiff(s):" "Section:" "Township:" etc.
>>
>>I have wrestled with this for over 3 hours and still only have some sloppy code to extract each of the data elements into their own data field. HELP.
>>
>>Plaintiff(s):The First National Bank of Chicago, as Trustee, etc. Section: Township: Defendant(s):Jonathan Mescon, if living or dead, the unk spouse, heirs, etc., et al Range: Subdivision: Knollwood
>>
>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform