Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
QUEST on: Delimited with
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00881597
Message ID:
00881674
Views:
32
Ah.., delim cannot help here as (AFAIK) it always eats the trailing spaces.
SDF/CSV do not use delimeters.
Looks like you need to work on the records one by one.

>This looks like we're working on a txt file rather than a dbf. So I ran your line but there was no difference in the resultant file. The thing is the location field is 15 spaces long but any trailing spaces get wiped out in the {COPY TO e:\output.txt DELIMITED WITH "" }statement. I actually need those spaces( as I may have already stated) :-(
>
>
>>- replace spaces with "+" in the string
>>- write file from the string.
>>
>>Sure replacing spaces with "+" may not work as you wish if there are spaces between words in the field.
>>In this case you need to get the line from each record one by one, format the string as needed and write it to the file.
>>
>>>not sure how to interpret exactly your suggestion,can you illucidate a bit further? thanks
>>>
>>>>I would use this:
>>>>
>>>>copy ... to (filename)....
>>>>
>>>>=strtofile(chrtran(filetostr(filename)," ","+"),filename)
>>>>
>>>>>That was the one I didn't try, I was almost out of choices!
>>>>>PS, what if I wanted output to look like:
>>>>>811AD,SUDBURY++++++++,B021193
>>>>>note the '+' being spaces.
>>>>>
>>>>>
>>>>>
>>>>>>Try:
>>>>>>COPY .. to .. delim with ""
>>>>>>
>>>>>>>I have the below data in a table acct(5), location(15),label(5)and I want to create the txt file shown below. Do I use copy to output type sdf, delimited, delimited with ",", not having too much luck creating what I want.
>>>>>>>
>>>>>>>
>>>>>>>"output.txt" =
>>>>>>>811AD,SUDBURY ,B021193
>>>>>>>811AD,SUDBURY ,B020910
>>>>>>>811AD,SUDBURY ,B022401
>>>>>>>811AD,SUDBURY ,B023021
>>>>>>>811AD,SUDBURY ,B023207
>>>>>>>811AD,SUDBURY ,B024342
>>>>>>>811AD,SUDBURY ,B024341
>>>>>>>811AD,SUDBURY ,B024382
>>>>>>>811AD,SUDBURY ,B024351
>>>>>>>811AD,SUDBURY ,B024352
>>>>>>>811AD,SUDBURY ,B020809
>>>>>>>811AD,SUDBURY ,B021653
>>>>>>>811AD,SUDBURY ,B023958
Previous
Reply
Map
View

Click here to load this message in the networking platform