>>>>>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
>>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.
>
>Very helpful - how do I put carriage return at and of each line
The 0h0D0A will add CR+LF where a line ends
the 0h adds a string literal in hex. You can change every string forward backward:
?'ABC'+0h44
?0h+'D'
?'D'=0h44
iow
CHR(13)+CHR10) is the same as 0h0D0A
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]