csv2tsv
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Apr 24, 2013
This example converts comma-separated values to tab-separated values in a single pass. It parses a CSV file from disk using `d3.csv.parse` and immediately formats the resulting data structure as TSV with `d3.tsv.format`. The tool reads its input from a file path provided as a command-line argument and writes the converted output to standard output, enabling easy redirection. The code relies on the `d3` library and Node.js’s `fs` module for file access, and it is intended to be run as an executable script.
AI-generated descriptionYou’ll need to npm install d3 and make the script executable (chmod u+x csv2tsv). Then you can run it like ./csv2tsv input.csv > output.tsv.
gpl-3.0 Licensed