Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Merging lines in a text file
Message
 
À
06/10/2014 10:31:17
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01608814
Message ID:
01608848
Vues:
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.

How do I denote a carriage return character at the end of each line
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform