How to Use a Comma Inside Quotation Marks in a CSV File
CSV stands for "Comma Separated Values." Most spreadsheet and database programs can open CSV files. CSV files work in a more universal fashion than proprietary formats such as Excel or Access because numerous applications can open it without compatibility problems. CSV files cannot retain formatting such as font styles or sizes. Only commas between the fields separate the field values. This gives rise to the question of how one would embed commas as part of the field value.
Instructions
-
-
1
Open the CSV file in the editing application. While spreadsheet programs can open a CSV file, the spreadsheet program prevents viewing of the file's field parameters. Text editors and word processors allow a plain-text view of the CSV file.
-
2
Create a field that uses an embedded comma. A common usage of this is the city and state field combination that many databases use. The field uses the comma to separate the city from the U.S. state abbreviation.
-
-
3
Enclose the entire data field from the earlier step in double quotation marks. Place a quotation mark at the start of the data field, and then another quotation mark at the end of the field. These quotation marks tell the program that the embedded comma is part of the field.
-
4
Save the file and exit. After the save, if imported into a database program, the program will recognize the correct delimiting of the embedded comma.
-
1
References
- Photo Credit Jupiterimages/Photos.com/Getty Images