Wednesday, October 10, 2012

Split line

tr ',' '\n' < input.file

A bash function to list a csv file's headers: (Aliases can't directly take parameters)
csvhd() {
head -n1 $1 | tr ',' '\n'
}

TODO: Update this to properly handle quoted fields.

Labels: ,

0 Comments:

Post a Comment

<< Home