csv2tbl 348 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. # csv2tbl fieldSep format in out
  3. if [ $# -lt 4 ] ; then
  4. echo "$0 fieldSep tblFormat inFile outFile" >&2
  5. echo >&2
  6. exit 1
  7. fi
  8. FIELD_SEP=$1
  9. TABLE_FORMAT=$2
  10. IN_FILE=$3
  11. OUT_FILE=$4
  12. AWK_FILE=$(dirname $0)/csv2tbl.awk
  13. awk -F"${FIELD_SEP}" \
  14. -v tblFormat="${TABLE_FORMAT}" \
  15. -f "${AWK_FILE}" \
  16. ${IN_FILE} > ${OUT_FILE}