[bash] add function to display csv
This commit is contained in:
parent
3d43c31715
commit
513425585a
14
bash/.bashrc
14
bash/.bashrc
|
@ -1,3 +1,16 @@
|
|||
function csv {
|
||||
# Format and display csv files in terminal
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Please specify file name"
|
||||
elif [ -f $1 ]; then
|
||||
# https://stackoverflow.com/questions/1875305/view-tabular-file-such-as-csv-from-command-line
|
||||
column -s, -t < $1 | less -#2 -N -S
|
||||
else
|
||||
echo "$1: File not found"
|
||||
#exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Set primary prompt
|
||||
PS1='fam@ubu:\w\$ '
|
||||
|
||||
|
@ -10,3 +23,4 @@ alias calsh='bash /home/calsh.sh'
|
|||
|
||||
alias sml='rlwrap sml'
|
||||
alias ghci='rlwrap ghci'
|
||||
|
||||
|
|
Loading…
Reference in New Issue