Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving .TXT/.PRG files into .DBF memo
Message
 
To
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:
00634504
Views:
22
Hello Hilmar!

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

No problem - max 200 lines in these files, and I'm now working with VFP7.

>
  • 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.

    Great idea! I've read about FileToStr() but didn't associate it with the task at hand.

    Knowing that in all these files there is always two sets of TEXT ... ENDTEXT (no more no less), could I use ATC() like so:
    n1startPos = ATC("TEXT",cPrgTxt,1)+5
    n1endPos = ATC("ENDTEXT",cPrgTxt,1)-1
    REPLACE cMemoField1 WITH SUBSTR(cPrgTxt,n1startPos,n1endPos-n1startPos)
    n2startPos = ATC("TEXT",cPrgTxt,2)+5
    n2endPos = ATC("ENDTEXT",cPrgTxt,2)-1
    REPLACE cMemoField2 WITH SUBSTR(cPrgTxt,n2startPos,n2endPos-n2startPos)

    That looks so good, I think I'll go give it a try!

    Thanks again,
    Randy Bosma
    VFP - Because life is too short to code in something else...
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform