How to Export CSV File with a Comma in the Data?

When exporting data to a CSV file using the ZappySys Export CSV Task, a common issue arises when your data contains commas (,) within text fields. Since CSV files use commas to separate fields, these internal commas can lead to misalignment or “out of sync” errors when the file is read by another system.

This article will guide you through how to properly handle comma-containing fields so your exported CSV remains structured and readable.

Why the Problem Happens

CSV stands for Comma-Separated Values. When one of your data columns contains a comma (e.g., 123, Main Street), the CSV parser might interpret this as two separate fields unless it’s properly enclosed in double quotes ("), which is the standard way to escape commas in CSV.

“CustomerID”,“Name”,“Address”
1,“John Doe”,“123, Main Street”
2,“Jane Smith”,“456, Oak Road”

Solution: Enclose Fields in Quotes

ZappySys Export CSV Task offers a way to enclose fields with special characters (like commas) in double quotes, ensuring the data is not misinterpreted during the export process.

Steps to Export CSV with Comma in the Data

Follow these steps to safely export your data to a CSV file even when your text fields contain commas:

  1. Drag the Export CSV Task to your SSIS Control Flow

    • Go to the SSIS Toolbox → under Common Section → select ZS Export CSV Task.
  2. Configure the Source Connection

  3. Set the Destination File Path

  4. Enable Quote Handling for Fields

    • Go to the Csv Options tab.
    • You can also set your preferred column and row delimiters.
    • :white_check_mark: Wrap data in quotes if needed
      For string and date type data
      OR
    • :white_check_mark: Always quote regardless datatypes
      Enclose all fields, including numeric, boolean, string, and date values, in double quotes for maximum compatibility.
  5. Test and Run the Package

    • Run the SSIS package and open the resulting CSV file.
      Export CSV Task

    • Verify that fields with commas are enclosed in double quotes:

    Notepad

Conclusion

Using the ZappySys Export CSV Task with proper quote settings and configurable delimiters ensures clean, parseable CSV exports—even when data contains commas or special characters. Customizing column and row delimiters further enhances flexibility for integration across various platforms.