Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More control in a .txt
Message
From
26/11/2010 07:10:05
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01490543
Message ID:
01490549
Views:
46
This message has been marked as the solution to the initial question of the thread.
>I need to write to a .txt but I can not just use "copy to type", because I need more control over the txt file.
>
>
> I have two tables: maintable.dbf and item.dbf and I need something as below:
>
>
>open my.txt file
>
> use table 1
>
> scan
>
> write: field1 + "|" + field2 + "|" + field3
>
> in the next line
>
> write: field4 + "|" + field5 + "|" + field6
>
>use item
> scan for condition
>
>write: field1 + "|" + field2
>
> in the next line
>
> write: field3 + "|" + field4
>
>endscan
> endscan
>

Hi Moises,

TEXTMERGE makes this pretty easy:
SELECT Table1
SET TEXTMERGE ON NOSHOW
SET TEXTMERGE TO MyFile.txt
SCAN
   \<<field1>>|<<field2>>|<<field3>>
ENDSCAN
SET TEXTMERGE OFF
SET TEXTMERGE TO
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform