Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving .TXT/.PRG files into .DBF memo
Message
From
19/03/2002 10:44:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00634479
Message ID:
00634480
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hello Foxperts;
>
>I'm in the process of converting an old dB5 system to VFP7.
>The old system had a series of .PRG files that were related to data records by a four digit number embedded in the file name. (i.e.- text from a .PRG file was printed in a report based on a numeric field; the information was contained between TEXT ... ENDTEXT commands.
>
>I would appreciate some direction in how to I might open the files and scan/extract the only information from between TEXT ... ENDTEXT commands. I've already figured out the REPLACE ... ADDITIVE command to put the text (a varying number of lines) into a memo field.
>
>Do I make a temp .dbf with one field: C(200), then SCAN ... ENDSCAN, look for lines beginning with TEXT or ENDTEXT? - or is there a niftier solution?
>
>TIA

If you have a maximum of 65000 rows, and if you have VFP 6 or later:

  • Convert file to a memory variable with FileToStr().
  • Convert memory variable to an array with alines().
  • Scan the array, and output the information to another textfile with ?, or to another variable, or directly to the memo field. Use REPLACE ADDITIVE for the memo fields.

    HTH, Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform