Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy To CSV and Field With Quotes and Commas
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Copy To CSV and Field With Quotes and Commas
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01392202
Message ID:
01392202
Vues:
117
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform