Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting columns in Excel
Message
 
 
To
17/06/2007 12:41:28
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7
Miscellaneous
Thread ID:
01233797
Message ID:
01233800
Views:
9
The COPY TO command does not support 'AS' clause in the field list. You can modify CSV file after creating it. Something like (untested)
lcFileName = "mycsvfile.csv"
COPY TO (lcFileName) FIELDS uic, para, lineno CSV
lcStr = FILETOSTR(lcFileName)
lcOldName = "lineno"
lcNewName = "line#"
lnPos = ATC(lcOldName, lcStr) 
lcStr = STUFF(lcStr, lnPos, LEN(lcOldName), lcNewName)
STRTOFILE(lcStr, lcFileName)
Or you can use COPY TO...DELIMITED to create a file w/o header row and than add teh header row.
>
>I am attempting to run the follwing program :
>COPY TO mycsvfile.csv FIELDS uic, para, lineno csv
>
>The problem is that I would like to run the following line of code but it's giving me syntax error:
>
>COPY TO mycsvfile.csv FIELDS uic, para, lineno as line# csv
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform