How to Use a Comma Inside Quotation Marks in a CSV File

How to Use a Comma Inside Quotation Marks in a CSV File thumbnail
Use commas within fields of a CSV document

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.

Things You'll Need

  • Windows Notepad or other text editor
Show More

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.

Related Searches:

References

  • Photo Credit Jupiterimages/Photos.com/Getty Images

Comments

You May Also Like

  • How to Include a Comma in a CSV File

    To include a comma in a CSV (Comma Separated Values) file enclose it between double quotes. A double quote on both sides...

  • What Is CSV?

    Comma-separated values (CSV) files are simple text files that contain data for a database table. Each line of a CSV file makes...

  • How to Convert a CSV File to Mac

    Most database, word processing and spreadsheet programs provide the option to save a document in another format for compatibility across platforms and...

  • How to Open a CSV

    Database and list managers commonly have to work with CSV files. CSV stands for "comma separated value" or "comma delimited." All that...

  • How to Use a Comma Before Quotation Marks

    Remembering the rules for using a comma before quotation marks can be a bit tricky. Fortunately, there are only a few such...

  • The Structure of Garmin CSV Files

    Garmin produces a number of GPS systems, from navigation units for us in automobiles to hand-held devices designed for hikers and outdoor...

  • How to Read an XLS File Using PHP

    Microsoft Excel is the normal program associate with the filetype XLS, and PHP is a much more widely used general purpose scripting...

  • How to Use Quotation Marks in Articles

    Using quotation marks correctly in an article means the writer shows precisely who said what. And while there are many published books...

  • How Do I Create a New CSV File?

    A .csv document is a file that is comma-delimited, meaning it is a list of data separated by commas. A .csv file...

Related Ads

Featured