root/bin/row @ 1480
1 |
#!/bin/bash
|
---|---|
2 |
# Gets a row of a spreadsheet, preceded by the header row. Designed for row #s
|
3 |
# in map error messages.
|
4 |
|
5 |
if ! test "$#" -eq 2; then |
6 |
echo "Usage: $0 row_num (zero-based, excluding header) sheet >row_out" |
7 |
exit 2
|
8 |
fi
|
9 |
|
10 |
head -1 "$2" |
11 |
# Add 1 for header row and 1 for tail's 1-based row #s
|
12 |
tail -n +"$(($1+2))" "$2"|head -1 |