How do I import a CSV with commas in field

By: F Ormid | Asked: 05/24/2025
ForumsCategory: How-toHow do I import a CSV with commas in field
F Ormid asked 3 weeks ago

Very basic question. I have a big Excel file (like 1000 entries) that I need to import with about 10 fields (that I will make into form fields in Formidale Forms).

4 of the fields are text that may (or may not) have commas.

Is there a way to convert my Excel so I can import into Formidable Forms with the commas? I don't want to add more text to the cell when it is imported into Formidable Forms (I am going to make the information also display in a table on a website), but rather just like in Excel.

If there is an easy way please let me know (or maybe if I should import another way). Thank you from a new user (not a programmer) ^^

2 Answers
Victor Font Staff answered 3 weeks ago

Everything is doable in Formidable until you said there are commas in the content that need to be preserved. This is something you have to fix in Excel.

Victor Font Staff replied 3 weeks ago

Here's what ChatGPT recommends:

To prepare an Excel spreadsheet for export as a CSV **when your data contains commas**, follow these best practices to avoid issues during database import:

---

### ✅ 1. **Wrap Fields with Special Characters in Quotes**

CSV (Comma-Separated Values) uses **commas as delimiters**, so **any field that contains a comma must be enclosed in double quotes**.

#### Example:

| Name | Address |
| ---------- | ------------------------- |
| John Smith | "123 Main Street, Apt 4B" |
| Jane Doe | "456 Elm St, Suite 200" |

Excel handles this automatically **if** you save the file correctly (see step 4).

---

### ✅ 2. **Avoid Manual Quoting**

Don’t manually add double quotes inside cells unless you **double them**:

* If you **must** use double quotes in a cell, Excel/CSV format requires you to **escape them** by doubling them.

#### Example (for literal quotes inside content):

`He said, ""Hello""` → becomes `"He said, ""Hello"""` in CSV

---

### ✅ 3. **Do Not Use Line Breaks in Cells (unless needed)**

Line breaks (`Alt + Enter` in Excel) will be preserved in the CSV, but they can break some parsers.

* If your import process allows it, it's okay.
* Otherwise, use a placeholder like `\n` and later convert it programmatically.

---

### ✅ 4. **Use “Save As” Properly in Excel**

When saving:

1. Go to **File > Save As**
2. Choose **CSV UTF-8 (Comma delimited) (\*.csv)**

* This ensures:

* Fields with commas are wrapped in double quotes.
* Unicode characters (e.g., emojis, non-English characters) are preserved.

---

### ✅ 5. **Test Your Output in a Text Editor**

Open the `.csv` in a plain text editor (like VS Code or Notepad++) and look for:

* Proper quoting of fields with commas
* No unexpected characters
* Proper line breaks (one row per line unless intended)

---

### ✅ 6. **Use a CSV Validator or Import Preview**

Before importing into your database:

* Preview the file in your database tool (like MySQL Workbench or phpMyAdmin).
* Or use a validator tool (many online CSV validators exist).

---

### 🔄 Bonus: Automate Clean CSV Export with a Script (Optional)

If you're exporting CSVs regularly, consider automating it with:

* **Python** (using `pandas.to_csv()`)
* **Excel VBA macro**
* Or **Power Query** in Excel

This helps enforce quoting and formatting standards consistently.

---

Let me know what kind of database you're importing into (e.g., MySQL, PostgreSQL, SQLite), and I can give more tailored advice or even generate the import script for you.

F Ormid answered 3 weeks ago

Thank you.Sounds like #4 should do everything. I was a bit concerned from an earlier post where I read there could be issues if some fields had double-quotes and some did not, but I guess this isn't a concern and the double-quotes should take care of everything during the save-as process.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right