Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Parse This Text
Message
From
23/05/2008 06:15:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01319144
Message ID:
01319174
Views:
17
>I have a file with the following text:
>
>
>     AR        (ENDBALS->AR         )  Numeric        Calculated
>        IIF(TRADES->PAY_REC = "REC",IIF(NOTSHIP>ENDBALS->ENDCASH.OR.(NOTSHIP<ENDBALS
>        ->ENDCASH.AND.ENDBALS->ENDCASH>0), ENDBALS->ENDCASH-NOTSHIP,0),IIF(
>        TRADES->PAY_REC = "PAY",IIF(NOTSHIP<ENDBALS->ENDCASH.OR.(NOTSHIP>EN
>        DBALS->ENDCASH.AND.ENDBALS->ENDCASH<0),ENDBALS->ENDCASH-NOTSHIP,0),
>        IIF((TRADES->PAY_REC="LM".OR.TRADES->PAY_REC="SM").and.ENDBALS->END
>        CASH >0,ENDBALS->ENDCASH,0)))
>     ARLINE    (ENDBALS->ARLINE     )  Numeric        Total
>        Sum(ENDBALS->AR(), ENDBALS->CUSTNUM, Automatic, Running)
>     ARTOT     (ENDBALS->ARTOT      )  Numeric        Total
>        Sum(ENDBALS->AR(), Grand, Automatic, Running)
>
>
>I want to parse out the table & field names, which are in the format of "TABLE->FIELD". I'm doing this in a low level file, so I'm using FGETS() to extract the info line by line.
>
>The problem is that some if the table & field pair wrap onto the next line.
>
>Anyone got any ideas?

Kevin,
I think you don't have a case where one line ends with a hypen and contiunes with gt on next line, if so simply:
lcStr = strtran(m.lcOriginal, '->','.')
If you might have such a case then using regular expressions would be better IMHO. W/o regexp you might use trimming including chr(9),chr(13),chr(10).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform