Lorixen.
EN

Your App CSV Export Looks Wrong in Excel: Seven Questions Owners Ask

Short answer: A CSV file is plain text with commas, and Excel guesses how to read it. The guesses go wrong in predictable ways: it assumes your computer's regional settings for separators and dates, it may ignore the file's text encoding, and it converts anything that looks like a number or date into one. Most problems are fixed on one side or the other by importing the file instead of double-clicking it, or by exporting with the right encoding, quoted text and unambiguous dates.

1. Why do my accents and symbols turn into odd characters?

Names like Siobhán or Müller appear as "Siobhán" or "Müller". The file is almost certainly saved as UTF-8, which handles every alphabet, and Excel opened it as an older Windows encoding.

What to do as the reader: open Excel first, use Data, then From Text/CSV, and choose UTF-8 as the file origin in the preview. Microsoft's page on importing and exporting text and CSV files describes the import route.

What to do as the app owner: ask your developer to write a byte order mark at the start of the export. Many Excel versions then recognise UTF-8 straight away. Test on the Excel versions your staff actually use, and test on a Mac too.

2. Why did the leading zero vanish from phone numbers and codes?

A number such as 0871234567 becomes 871234567, and a postcode like 02134 becomes 2134. Excel sees digits and stores them as a number, and numbers have no leading zeros.

Reader: in the import preview, set that column's type to Text before loading.

Owner: you cannot force Excel's behaviour from a plain CSV. Options are to export a real spreadsheet file (.xlsx) for these columns, or to document the issue next to the Download button. Some teams prefix with an apostrophe or wrap the value as ="0871234567", but those tricks can corrupt re-imports into other systems, so treat them as a last resort and label the file as "for viewing only".

3. Why is everything squashed into one column?

Excel in many European locales expects semicolons, not commas, because the comma is the decimal mark there. A file using commas then opens as a single wide column. The reverse happens in places where semicolons are unexpected.

Reader: use the import dialog and pick the delimiter, or use Text to Columns on the data.

Owner: offer a delimiter choice on the export screen if your customers span regions. Mention the choice in the help text.

4. Why are my dates wrong or showing as hash signs?

A date written 03/04/2027 means 3 April in Ireland and the UK, and 4 March in the United States. Excel applies the computer's setting, so staff in two regions see different dates from the same file. Some dates also flip silently, with day and month swapped when the day is 12 or less.

Owner: export dates as 2027-04-03 (year, month, day). It is unambiguous and sorts correctly. The CSV specification says nothing about dates, so this is a convention you choose. For times, include the time zone or state clearly that all times are in the business's local time.

Reader: if you only see ####, widen the column; it is just too narrow.

5. Why did Excel change my product codes into dates or scientific notation?

A code like 1-3 becomes 3 January, and 12E5 becomes 1.2E+06. Excel is helpfully converting things that look like dates or exponents.

Reader: import the column as Text.

Owner: if codes are routinely at risk, add a prefix character in a separate "display code" column, or deliver .xlsx with the column pre-typed as Text.

6. Why does one row break into two lines, or the columns shift?

A customer note containing a comma, a quote or a line break can shift columns if the export did not wrap it correctly. The specification says fields with commas, quotes or line breaks must be enclosed in double quotes, and a quote inside the field is doubled.

Owner: a developer should use a proper CSV library, never assemble the line by joining strings with commas. Create a test row with all awkward characters: commas, quotes, an apostrophe, a line break, an accent and a leading zero. Keep that row in the test data forever.

Reader: if your row shifted, look at the row above for an open quote and report the record to whoever maintains the app.

7. Should we just export Excel files instead?

Sometimes, yes. A .xlsx file can fix types, column widths and dates for people who only read the data. A CSV remains better for moving data between systems, because it is simple and tool-neutral. The honest answer is to offer both when the audience is mixed, and name them clearly: "Spreadsheet for reading (.xlsx)" and "Data file for other systems (.csv)". Be careful not to treat the reading file as the one to re-import, because formats and cleaned-up values differ.

A quick test before you ship an export

  • [ ] Open the file by double-clicking on Windows and on a Mac.
  • [ ] Open it through the import dialog.
  • [ ] Check an accented name, a postcode with a leading zero, a note containing a comma and a quote, and a date on the 5th of a month.
  • [ ] Open it in a second tool such as a free office suite or Google Sheets.
  • [ ] Re-import it into your own app and confirm nothing changes.

FAQ

Can the app detect the user's Excel settings?

Not reliably. A browser does not know Excel's locale, so make the export predictable instead of clever.

Is Google Sheets better at CSV?

It handles UTF-8 well and lets you choose the separator on import, but it also guesses types, so the leading zero and date issues can still appear.

Why does the file look fine in Notepad?

Because Notepad shows the raw text. The faults come from how Excel interprets it.

If your reports or customer exports keep arriving mangled, send us a sample file and we will sort the export format out.

Sources

WhatsAppBook a call