Mercurial > repos > sem4j > sql_tools
annotate editheader.sh @ 5:d316d1155e08 draft
Uploaded
author | sem4j |
---|---|
date | Wed, 25 Sep 2013 02:45:30 -0400 |
parents | cae968c828b8 |
children |
rev | line source |
---|---|
4 | 1 |
2 # USAGE: $ sh editheader.sh "col1 col2 col3" input.txt output.txt 0 | |
3 | |
4 # 1 HEADER | |
5 # 2 INPUT_FILE | |
6 # 3 OUTPUT_FILE | |
7 # 4 DELETE_FLG | |
8 | |
9 if [ $4 == 0 ]; then | |
10 echo "The first row will NOT be deleted." | |
11 echo -e "$1" | cat - $2 > $3 | |
12 else | |
13 echo "The first row will be deleted." | |
14 echo -e "$1" | cat - $2 | awk 'NR!=2 {print}' > $3 | |
15 fi |