csv2tbl.awk 323 B

1234567891011121314151617181920
  1. BEGIN {
  2. OFS=" & ";
  3. ORS=" \\\\\n";
  4. printf "\\begin{tabular}{%s}\n", tblFormat;
  5. }
  6. NR==1 {
  7. for(i = 1 ; i <= NF ; i ++) {
  8. $i = sprintf( "\\textbf{%s}", $i);
  9. }
  10. print $0
  11. printf "\\midrule\n";
  12. }
  13. NR != 1 { $1=$1 ;print $0 }
  14. END {
  15. printf "\\bottomrule\n";
  16. printf "\\end{tabular}\n";
  17. }