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.
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
- You have a metadata export, privilege log, production index or load-file style CSV and need to review or filter it in Excel without corrupting the values.
- A file contains document IDs, phone numbers, account numbers or Bates numbers with leading zeros or more than 15 digits.
- A delimited file is too large to open in Excel in one go.
How to run it
- Choose the folder (or a single file) as Input. By default
.csvand.tsvfiles are converted; add other extensions such as.txtunder extensions if needed. - Choose an Output folder outside the input folder.
- Leave delimiter on
Autounless the detection gets it wrong. - Turn header-row off if the first row is data rather than column names.
- Click Run.
- Click Open report and read the Details column for each file, then open the workbooks from the
filesfolder.
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
| Setting | What it does | Type 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, PipeAuto |
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/notrue |
Common settings
| Setting | What it does | Type 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/notrue |
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. | number4 |
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).
files\export.csv.xlsx …: One workbook per input file, named after the original file with.xlsxadded, in the same folder structure as the input.csv-to-excel.csv: One row per file: the Encoding and Delimiter used, Rows (including the header row), Columns, Sheets, TruncatedCells, Details of any problems, and the SHA-256 of the workbook.errors.csv: Files that could not be converted, for example a row with more fields than Excel has columns. No workbook is written for those files.
Report columns
RelativePathFileNameEncodingDelimiterRowsColumnsSheetsTruncatedCellsDetailsDestinationOutputSHA256SourcePath
Check the result
- Read the Details column. It reports empty files, rows with a different number of fields from the first row, a quote that is never closed, cells that were cut short, and files that continue over more than one sheet.
- If a file has a quote that is never closed, everything from that row to the end of the file is in one cell. Check the source file at the row given.
- Compare Rows with the number of records you expect from the source system.
- Check the notes for cells longer than 32,767 characters: the full values are only in the original files.
- 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.
- 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
- Email Metadata: Reads subject, sender, recipients, sent/received dates, Message-ID and attachment names from .msg and .eml files.
- File Inventory: Lists every file with size, timestamps, attributes, hashes and detected file type, flagging extensions that don't match the content.
- Create Load File: Creates a Concordance DAT and Opticon OPT load file for a production folder, grouping natives, images and text by Bates number.
- Convert Load File: Converts load files: DAT, CSV, tab and Excel data files into each other, and OPT into LFP or back. Can also keep, order and rename fields, rewrite paths, set the volume and change the encoding.