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