Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Merging lines in a text file
Message
From
06/10/2014 10:31:17
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01608814
Message ID:
01608845
Views:
32
>>
>>lcx = ''
>>lcDelim = ' '
>>sele one && Field cHeader for the headers
>>scan
>> lcx = lcx+alltr(cHeader)+lcDelim
>>endscan
>>lcx = left(lcx,len(lcx)-len(lcDelim))+0h0D0A
>>
>>sele two
>>scan
>> lcx = lcx+transform(Field1)+lcDelim
>> lcx = lcx+transform(Field2)+lcDelim
>> *..
>> lcx = lcx+transform(Fieldn)+lcDelim
>> lcx = left(lcx,len(lcx)-len(lcDelim))+0h0D0A
>>endscan
>>lcx = left(lcx,len(lcx)-2)
>>
>>strtofile(lcx,'Yourfile.ext')
>>
>>
>>something like this?
>>You can replace TRANSFORM with something mor meaningfull, also remove spaces etc.
>
>Seems to work but every fleld has to be worked on separately because they have differnt lengths and properties - but thanks

Then instead of transform() you may just do padr(), and you'd only need a list of lengths for each column.
Now if you want to have multiline values, i.e. any wrapping of long values, this will get complicated very fast.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform