-
-
Save kevinhq/bd285288b1c111cf510314891a7452f0 to your computer and use it in GitHub Desktop.
Revisions
-
soxofaan revised this gist
Oct 21, 2016 . 2 changed files with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ # pretty_csv/pretty_tsv These are some simple bash functions and scripts for making CSV/TSV files prettier on the command line see [http://stefaanlippens.net/pretty-csv.html](http://stefaanlippens.net/pretty-csv.html) for more information. File renamed without changes. -
soxofaan created this gist
Oct 21, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ #!/bin/bash perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' "$@" | column -t -s, | exec less -F -S -X -K This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ ##################################################### # Bash functions to put in .bashrc or .bash_aliases # ##################################################### # For Debian/Ubuntu function pretty_csv { column -t -s, -n "$@" | less -F -S -X -K } function pretty_tsv { column -t -s $'\t' -n "$@" | less -F -S -X -K } # For non-Debian systems function pretty_csv { perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' "$@" | column -t -s, | less -F -S -X -K } function pretty_tsv { perl -pe 's/((?<=\t)|(?<=^))\t/ \t/g;' "$@" | column -t -s $'\t' | less -F -S -X -K } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ #!/bin/bash perl -pe 's/((?<=\t)|(?<=^))\t/ \t/g;' "$@" | column -t -s $'\t' | exec less -F -S -X -K