Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active February 9, 2016 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbostock/5455427 to your computer and use it in GitHub Desktop.
Save mbostock/5455427 to your computer and use it in GitHub Desktop.
csv2tsv
license: gpl-3.0

You’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.

#!/usr/bin/env node
var fs = require("fs"),
d3 = require("d3"); // require("dsv") would work, too
console.log(d3.tsv.format(d3.csv.parse(fs.readFileSync(process.argv[2], "utf8"))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment