Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
QUEST on: Delimited with
Message
From
01/03/2004 12:03:02
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00881597
Message ID:
00882084
Views:
24
Hi Timothy
select acct, padr(alltrim(location)),15," ") as location, label into cursor newcursor
Drop the "+" and replace it with " " and you should get what you're after.

>ok I got that to work and I now have plus signs "+" padding the remainder of the field which is what I want. Now I want to turn these "+" into blank spaces somehow. I originally tried the following command
>COPY TO e:\output.txt DELIMITED WITH ""
>but that only served to remove the trailing blanks from LOCATION. I thought having the "+" I could somehow transform them to blank spaces.
>
>
>
>>Uh. Timothy? I missed the keyword "cursor" (between the keyword "into" and the cursor name "newcursor") and I reversed the sequence of the last two parameters of the padr() function. I was obviously having a dyslexic moment. You don't really expect a quick post to run, do you ;) Besides, debugging is half the fun, no?
>>
>>This might work. Bear in mind that I don't have your table, nor would I name the fields as you did ;)
>>
>>
select acct, padr(alltrim(location)),15,"+") as location, label into cursor newcursor
>>
>>>mike can you recheck your select statement, vfp didn't like it.
>>>
>>>>Select acct, padr(alltrim(location),"+",15) as location, label into newcursor
>>>>COPY TO ...
>>>>
>>>>>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