Processing

Convert CSV To Excel

Converts CSV, TSV and other delimited text files to Excel workbooks with every value kept exactly as typed, so leading zeros, long numbers and dates are not changed.

Free Command line: csv-to-excel Version 1.0

When Excel opens a CSV file directly, it guesses what each value is. Control numbers lose their leading zeros, long account or document numbers are rounded after 15 digits, dates are reformatted and codes such as 1E5 become numbers. Convert CSV To Excel avoids this: every value is stored as text, exactly as it appears in the file, and the cells are formatted as Text so values typed in later stay text too.

Each input file becomes its own .xlsx workbook. Quoted values may contain commas, quotes and line breaks. The file's encoding and delimiter are detected automatically. Excel's size limits are handled: very long values are cut to Excel's maximum and reported, and files with more rows than one sheet can hold continue on further sheets.

Use it when

How to run it

  1. Choose the folder (or a single file) as Input. By default .csv and .tsv files are converted; add other extensions such as .txt under extensions if needed.
  2. Choose an Output folder outside the input folder.
  3. Leave delimiter on Auto unless the detection gets it wrong.
  4. Turn header-row off if the first row is data rather than column names.
  5. Click Run.
  6. Click Open report and read the Details column for each file, then open the workbooks from the files folder.

Settings

Every setting has the same help beside it in the app. On the command line, pass each as --name value; ltk help csv-to-excel lists them.

Settings

SettingWhat it doesType and default
Delimiter
--delimiter
Field separator. Auto detects comma, tab, semicolon or pipe from the start of each file.
Auto tries comma, tab, semicolon and pipe on the start of each file and picks the one that splits the rows most consistently; ties go to tab for .tsv files and comma otherwise. The report's Delimiter column shows what was used. If a file comes out in one column, or rows are reported with differing numbers of fields, set the delimiter yourself and run again.
choice: Auto, Comma, Tab, Semicolon, Pipe
Auto
Header row
--header-row
The first row holds column names: it is made bold, frozen and given filter buttons (and repeated at the top of any extra sheet).
When on, the first row is bold, frozen so it stays in view, and given filter buttons. On any extra sheets it is repeated at the top. Turn it off for files with no column names.
yes/no
true

Common settings

SettingWhat it doesType and default
Input required
--input
Folder (or single file) to read. It is opened read-only and never modified. folder
empty
Output required
--output
Folder for reports. Must not be inside the input folder. Each run gets its own sub-folder. folder
empty
Recurse
--recurse
Include sub-folders. yes/no
true
Extensions
--extensions
Only process these extensions (e.g. .pdf, .docx). Empty means the tool's default set. list
empty
Parallelism
--parallelism
Files processed at once. Use 1-2 for spinning disks or network shares. number
4

What you get

Each run creates its own folder inside the output folder, with the report csv-to-excel.csv, errors.csv and manifest.json (see Run folders and manifests).

Report columns

Check the result

Tips
  • Values that look like formulas, such as =SUM(A1), are stored as text and never run as formulas when the workbook is opened.
  • Leading and trailing spaces are kept as they were in the file.
  • The same input always produces exactly the same workbook, with the same hash, so a re-run can be compared with an earlier one.
  • Encoding is detected from the whole file: UTF-8 (with or without a byte order mark), UTF-16 with a byte order mark, Japanese Shift-JIS and the older Windows-1252 encoding are handled, so accented names come through correctly.
Watch out for
  • Because every value is text, Excel will not sum or sort numbers and dates numerically. Convert the specific columns you need in Excel after reviewing the data.
  • Cells longer than Excel's 32,767-character limit are cut to that length. Do not treat the workbook as a complete copy of a file whose report shows TruncatedCells above zero.

From the command line

The command line is part of LitTechKit Pro. See Command line.

ltk run csv-to-excel --input "D:\Matter\Exports\metadata.csv" --output "D:\Matter\Excel" --delimiter Auto --header-row true

Related tools