Created
March 12, 2018 20:05
-
-
Save m3nd3s/886b422ee359f4f3b759bab9c1490b40 to your computer and use it in GitHub Desktop.
Console Pretty CSV
This file contains 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 characters
#!/bin/bash | |
PATH=$PATH:/usr/bin:/bin:/usr/local/bin | |
while [ "$1" != "" ]; do | |
case $1 in | |
-s ) shift | |
SEPARATOR=$1 | |
;; | |
* ) FILEPATH=$1 | |
esac | |
shift | |
done | |
SEPARATOR=${SEPARATOR:-,} | |
cat $FILEPATH | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s "${SEPARATOR}" | less -S |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment