Insert Comma in CSV file

Chaitanya76

Active Member
I am creating a CSV file using B34A1010 (Flat File Functions) at remote location.
sample data is like below, I am having issue with row 2 when ALPH has one comma in between. When I open this csv file, first row prints in 3 columns and row 2 print in 4 columns.

AN8,ALPH,City
11,jdelist,New York
22,jde,list,Chicago

Thanks for help.

-Chaitanya
ERP 9 , 8.98 tool set, sql server
 
Chaitanya,

The problem is that the data contains a comma and the definition of the file treats it as another column. Depending on how you are opening this file - you do not say - puting inverted commmas ("") around the data may help - especially if you are opening it with excel. If it is being opened by some other process/application you may need to remove commas from the data before building the CSV row.
 
You can probably try using the database output feature for the reports instead of this function, which may give you flexibilty to handle the extra comma in the field.

Thanks,
Mridul
 
Note: Proper CSV Standards 'assume' that Strings/Characters are within quotes ("string") and numbers have been stripped of any comma delineation (1000000.00 NOT 1,000,000.00).

For simplified exporting, consider using the export to CSV functionality (it has been discussed more times on the list, than the good effects of Double-Caffeinated Mocha's).

Database Output is another option ~ it does take a little more setup.

If you are building the export as part of an interface (not user controlled) ~ Both the function and Database Output are your friends.

You may want to build a couple functions that concatenate the numbers / strings in the desired formats (encapsulated "" or stripped ,)

(db)
 
Thanks for help.

Just padded filed with " like ("ALPH") and it worked.

-Chaitanya
 
Hi ,
Iam having a problem too with output CSV with the item CO 00002, so in the CSV file it display just 2 and not with the 0000 , how to configure it? is there any way to fix this problem, thanks
 
i have some problem with CSV output when i want to show CO item, as it shows 00002 but in CSV it shows 2, is there any configuration for it item? thanks
 
Gonzalo,

When Excel opens - DO NOT SAVE the CSV. Then, Open the .CSV with NotePad - I will bet the CO is "00002" not 2. The reason you are seeing it as a '2' is because you have Saved the .CSV from Excel. Excel will mis-convert the value - thus, the issue.

(db)
 
Back
Top