AI & Technology

How to translate CSV data safely

Oct 09, 2026

How to translate CSV data safely

To translate CSV data safely, select the columns that contain human-readable text, keep identifiers and numeric fields unchanged, then parse and compare the exported file before importing it. A readable translation is only one acceptance check. The destination system must still recognise the same records and interpret every field in the intended column. Work on a copy and keep the original export as your comparison baseline.

Choose text columns before translating

Translate descriptions and other display text only after you have identified how the receiving system uses each column. A column called status may contain a visible label, or it may contain a fixed value such as pending that an application expects. Treat unknown fields as protected until the owner of the import confirms their meaning. Header names can also be machine-readable keys: keep description as description even when its values change language.

Write down a simple column plan: description is translatable; item_id, price, URLs and internal codes are protected. Preserve empty values and duplicate records unless a separate data-cleaning task authorises changes. If you extract text for translation, attach each value to an unchanged identifier and column name. Reinsert it by that mapping, not by guessing from row order after sorting.

Record the CSV dialect and encoding

Use the export settings and the destination importer to establish the delimiter, quote character, header handling and encoding. A .csv extension does not tell you whether the separator is a comma or semicolon. Keep the accepted dialect throughout the translation workflow; changing the separator to suit a language can turn one record into the wrong set of fields.

RFC 4180 is an informational RFC describing a common comma-separated convention, not a universal standard for every CSV dialect. It describes consistent field counts, double-quoted fields containing commas, quotes or line breaks, and doubled embedded quotes. Its MIME registration allows a charset parameter and notes implementation differences. Check what your importer actually accepts.

Prefer UTF-8 when the receiving system supports it, and select it explicitly during import. Check accented characters and the target script in the preview. If the receiver requires another encoding, confirm that it can represent the translated text before exporting. A question mark replacing a character is lost data, not a translation choice.

Let a CSV writer escape the translated text

Parse fields with a CSV reader and export them with a writer configured for the chosen dialect. Splitting each line on commas fails when a description contains a comma; counting physical lines fails when a quoted field contains a newline. Do not remove punctuation just to make those shortcuts appear to work.

This small English-to-French example is educational, not a ForgeFile product test. Only description changes. Both files have four fields per record; item_id, sku and price remain identical. The translated comma belongs inside the quoted description, and the double quote around compact is represented by two double quotes on each side.

item_id,sku,price,description
00127,A-09,12.50,"Small lamp, ""compact"" model"
item_id,sku,price,description
00127,A-09,12.50,"Petite lampe, modèle ""compact"""

CSV (EN) · CSV (FR)

Compare parsed records, not just the visible text

After export, parse the original and translated copies with the same explicit settings. Compare the header names and order, the number of records, and the number of fields in every record. Match records using a stable identifier; if IDs are not unique, use an agreed composite key or preserve the original row mapping. A successful parse alone does not prove that values stayed attached to the right item.

Compare every protected field as a string. The identifier 00127 must remain 00127, not 127; a price written as 12.50 must not become 12,50 just because the translation is French. Check empty descriptions, quoted text and multiline values separately. Review meaning as well: a structurally valid file can still contain a mistranslated product instruction.

Use the import preview before committing records

Import a small representative copy into a test destination or use the receiving system’s preview first. Set ID and code columns to text where that option exists. CSV quoting does not force a spreadsheet to keep leading zeros, and automatic type detection can reinterpret dates or decimal values. Check the preview against the raw export rather than trusting how a spreadsheet displays it.

Include records with leading zeros, empty fields, accents, a comma and embedded quotes in your trial. Confirm the column mapping and inspect a translated record in the destination after the trial import. If the preview moves fields or changes protected values, stop and correct the dialect or type settings. Keep the source copy until the final import has been checked; a preview reduces uncertainty but does not replace validation.

A catalogue import that loses an ID

A teaching example: the source ID is 00127, but the import preview shows 127. Stop here. Quotes protect CSV syntax; they do not require an importer to treat a value as text. Choose the destination’s text type for the ID column before importing, then confirm that 00127 still matches the original catalogue record. If the zero has already disappeared from the saved file, changing the display format will not recover the original ID. Re-export from the source.

SourceFaulty previewCorrected preview
0012712700127

ID column imported as text: 00127 → 00127

Ready to work with your CSV?

Review the CSV translation page, then apply the column plan and validation checks to your own file.

View CSV translation