DelimiterChanger
A VS Code extension that changes the delimiter of table-form text files (csv / dat / tsv).
Pick a file or folder in the Explorer and choose Change Delimiter — that's it.
The source file is never modified; the result is written to a new file carrying the
target delimiter's extension.
Supported delimiters
| Kind |
Extension |
Output separator |
Recognized forms |
| CSV (comma) |
.csv |
", " |
, , , , … |
| DAT (space) |
.dat |
" " |
" " " " … (a run of spaces is one separator) |
| TSV (tab) |
.tsv |
"\t" |
\t \t \t … |
Detection accepts a wide range of forms; writing always uses the canonical output
separator from the table above.
Usage
A single file
Right-click a file in the Explorer → Change Delimiter.
A QuickPick opens showing the current delimiter as a header, the convertible targets,
and a Cancel entry. Choosing a target creates name.targetExtension in the same folder.
(If the target file already exists, you are asked before it is overwritten.)
Multiple files / a folder
- Select several files and run the command → the selection opens in a batch tab
(a tree rooted at the common parent folder).
- Select a single folder → it is scanned recursively and every table file found opens
in the batch tab.
The batch view
The tree of files is on the left, with three columns — CSV, DAT, TSV — on the right.
| Action |
Result |
● marker |
the delimiter detected for that file (tooltip says "inconsistent rows" when rows disagree) |
| Click an empty cell |
convert that one file to the column's delimiter |
Click a column header (CSV/DAT/TSV) |
convert every listed file to that delimiter |
| Click a file row |
select it (Shift for a range, Cmd/Ctrl to toggle) |
| Click a cell with several rows selected |
convert the selected files in one go |
| Click a file name |
open the file in the editor |
Expand All / Collapse All |
expand or collapse the whole tree |
⟳ Reload |
rescan to refresh detection results and pick up newly created files |
Every conversion is confirmed first, and when target files already exist you can choose
Overwrite All or Skip Existing. A summary reports how many files were created,
skipped, and failed.
Conversion rules
- Trailing
,, spaces, and \t at the end of header and data rows are removed.
- Padding spaces around fields are removed:
a , b → a, b
- Quoted fields (
"...") keep their content verbatim, and "" is treated as a literal ".
Fields that would become ambiguous under the target delimiter (containing the separator
or leading/trailing spaces) are re-quoted.
- Blank lines pass through unchanged.
- Line endings (LF / CRLF / CR, even when mixed), a missing final newline, and a BOM are
all preserved exactly as in the source.
Settings
| Setting |
Default |
Description |
delimiterChanger.exclude |
[".git", "node_modules"] |
Files and folders to skip during a folder scan. Supports globs (*, **, ?). Patterns without a slash match by base name at any depth (*.log); patterns with a slash match the path relative to the scanned folder (build/*). |
delimiterChanger.scanExtensions |
[".csv", ".tsv", ".dat", ".txt"] |
Extensions considered table-file candidates when scanning a folder. Files selected explicitly in the Explorer are examined regardless of extension. |
Limitations
- UTF-8 (with or without BOM) and EUC-KR/CP949 text are processed; the output file keeps the
source file's encoding. Files in other encodings are reported as errors.
- No file-size limit: files larger than 50 MB are converted line-by-line with constant memory.
- Delimiter detection samples the first 256 KB of a file, up to 1000 lines.
- Files with unsaved editor changes are not converted; you are asked to save them first.
- Binary extensions (images, archives, …) are skipped during scanning.
License
MIT
| |