Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Merging lines in a text file
Message
 
À
06/10/2014 06:40:07
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
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:
01608836
Vues:
39
>>>>It is probably a Monday morning blind spot
>>>>
>>>>I want to create a text file where the headings all alphabetic are on one dbf
>>>>
>>>>and the detail to go under the headings is a mixture of text, numeric and dates on another dbf
>>>>
>>>>Can I copy the data from the first file to a text file and somehow append the data from the second file to the same text file?
>>>>
>>>>Thanks
>>>>
>>>>
>>>>Colin
>>>
>>>Sure,
>>>Check STRTOFILE() function and especially last parameter :-)
>>
>>Thanks can you give me example code
>>
>>one.dbf has the text headings
>>
>>two.dbf has the data which should appear in the text file under the headings
>>
>>Thanks
>>
>>Colin
>
>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
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