Skip to content

Convert tab-delimited file to Excel-style comma-delimited. Only fixing critical bugs currently.

Notifications You must be signed in to change notification settings

MackeyRMS/tsv2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tsv2csv Hackage

Convert tab-delimited text to Excel-style comma-delimited

According to some, Excel does it right. Some disagree. See http://superuser.com/questions/302334/true-difference-between-excel-csv-and-standard-csv.

This program follows the rules mentioned in the linked page:

If a cell contains a comma, a newline, or a double-quote, surround it in double-quotes. Otherwise, output it as is.

Build

Cabal:

cabal sandbox init
cabal install --dependencies-only
./install.sh

The result is tsv2csv in the $HOME/.cabal/bin directory, which should be on your path.

which tsv2csv | xargs ls -l

Stack:

make install

Run

tsv2csv < input.tsv > output.csv

The intention is to compose a pipeline such as

sed 's/NOTE_TYPE_ID/14/g' db/stock-target-vs-downside.sql | ssh central@central '~/bin/mys devh' | tsv2csv

To run tests, use:

cabal build && echo runTests | cabal repl

About

Convert tab-delimited file to Excel-style comma-delimited. Only fixing critical bugs currently.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •