Reorganise gists folder
This commit is contained in:
12
codegrab/csv_cols
Executable file
12
codegrab/csv_cols
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
#check if comma or semicolon
|
||||
if [[ $( grep -c ',' $1 ) -gt $( grep -c ';' $1 ) ]]
|
||||
then
|
||||
delim=','
|
||||
else
|
||||
delim=';'
|
||||
fi
|
||||
|
||||
#get headings and display them
|
||||
head -n1 $1 | tr "$delim" "\n" | nl
|
||||
|
||||
Reference in New Issue
Block a user