CSV and spreadsheet conversion
How To Convert Text File To CSV In Excel?
How To Convert Text File To CSV In Excel. Check delimiters, column types and the saved file using a small example. Keep original source records.
First determine whether the text file is delimited or fixed-width. Import it into separate columns and inspect the result before exporting CSV. Renaming .txt to .csv does not split a fixed-width file or repair inconsistent record boundaries.
Import text, then export a real CSV
- Keep the original TXT file and open a fresh workbook.
- Use a text import workflow to select its actual separator or fixed-width boundaries. Inspect the preview before loading.
- Set identifier-like columns to text and confirm that headers are not mistaken for data.
- Load the table and compare representative rows with the source.
- Save a workbook copy, then export the intended worksheet as CSV under a separate filename. Reopen the resulting text and verify its comma and quoting rules.
A file extension alone does not define a valid table. If the source contains prose or irregular spacing, specify a meaningful record and field mapping first. Automated splitting cannot infer that mapping reliably from an ambiguous example.
Check the intermediate table
For fixed-width text, column boundaries refer to character positions rather than separator symbols. Check several records before choosing widths because a longer name can reveal an incorrect boundary that a short sample hides. Once the data is in cells, verify that no field was split or merged unintentionally. CSV export can quote the resulting values correctly, but it cannot repair an incorrect mapping performed during the initial import.
Use a small fidelity test
Before processing the full file, include a record with identifier 00123, name Bose, Mira, date text 2026-09-29, amount 1250.50, and note He said "ready". Add a second record with an empty note. This exposes the important differences between a number, a text code, punctuation inside a field and a missing value.
For comma-separated output, the name containing a comma needs quotation marks. A quote inside a quoted field is represented by doubling it. A line break inside a quoted field is part of one record, so counting physical text lines is not always the same as counting table rows. Use a CSV parser when validating record counts.
Separate values from display formats
Leading zeros, long account-like identifiers and date-looking strings are common conversion traps. Decide their intended types before import. A numeric cell formatted to show five digits is different from a text value containing five literal characters. If a numeric conversion has already removed significant digits, changing the cell’s display format afterward cannot reconstruct them.
CSV does not carry a schema identifying a column as a date, number or text. A receiving program makes its own interpretation. Document the expected types alongside the export. Use a consistent date convention and decimal convention, and keep identifiers as text when arithmetic on them would be meaningless.
Verify the actual file
- Compare the source and destination record counts with a parser, accounting for any header row.
- Check the first, middle and last records, including a blank field and a value containing punctuation.
- Inspect non-ASCII names and symbols to confirm the encoding was interpreted correctly.
- Check whether formulas became calculated values or literal formula text, according to the intended export.
- Confirm that the receiving system assigns the intended column types rather than silently converting identifiers.
Common problems
If every record appears in one column, inspect the delimiter setting. If one record has too many columns, inspect CSV quoting rather than deleting punctuation. If dates change appearance after reopening, inspect the literal saved text and the importer’s type rules separately. If an entire worksheet seems absent, verify which sheet was active when exporting; CSV is not a multi-sheet container.
For repeated deliveries, keep a small written specification containing encoding, separator, header names, column types and the meaning of empty fields. Test the conversion against that specification after any application or export-setting change. This is more reliable than judging success from a spreadsheet preview that may have already reformatted the values.
References
Microsoft: import and export text files, save a workbook in text format, and Text Import Wizard.


