Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy To CSV and Field With Quotes and Commas
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Copy To CSV and Field With Quotes and Commas
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01392202
Message ID:
01392202
Views:
116
If you use the copy to csv command with a cursor that has a text field that has quotations and commas, you can end up with a csv file that cannot be opened by Excel properly.
create cursor c_test (textfld1 C(50), numfld1 N(10,2))

insert into c_test (textfld1,numfld1) values ('test test',12345.67)
insert into c_test (textfld1,numfld1) values ('test 9", test 10", test',12345.67)
insert into c_test (textfld1,numfld1) values ('test test',12345.67)


COPY TO c:\foxpro\myfile.csv TYPE CSV 
You see how that second row will take 4 columns to display in Excel instead of just 2 columns like it should?
Brandon Harker
Sebae Data Solutions
Next
Reply
Map
View

Click here to load this message in the networking platform