diff options
author | Karl Berry <karl@freefriends.org> | 2011-05-06 23:11:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-05-06 23:11:09 +0000 |
commit | dd7af068e51a47c08099a43fb61ea411bede43ba (patch) | |
tree | 2cac021aac283c04531af2a41f17221c22d148ab /Master/texmf-dist/doc/latex/latex4wp-it/dat2tex | |
parent | ea51be9a747e2afe1d8349c7ea0b386b20f8c746 (diff) |
new italian doc latex4wp-it (6may11)
git-svn-id: svn://tug.org/texlive/trunk@22335 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/latex4wp-it/dat2tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/latex4wp-it/dat2tex | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/latex4wp-it/dat2tex b/Master/texmf-dist/doc/latex/latex4wp-it/dat2tex new file mode 100644 index 00000000000..f7378a51973 --- /dev/null +++ b/Master/texmf-dist/doc/latex/latex4wp-it/dat2tex @@ -0,0 +1,28 @@ +#!/bin/sh + +# dat2tex: converts tabular data to a tabular environment + +if [ $# != 1 ]; then + echo "Usage: $0 <datafile>" + exit 1 +fi + +# is this a cvs file? +grep ";" $1 > /dev/null +if [ $? = 0 ]; then + AWK="awk -F;" +else + AWK=awk +fi + +# ok awk, make my day +$AWK '{if (1 == FNR) { \ + printf "\\begin\{tabular\}\{"; \ + for (i = 1; i <= NF; i++) {printf "l"}; \ + printf "\}\n" + } + for (i = 1; i < NF; i++) \ + {printf $i" & "} printf $NF" \\\\ \n"} \ + END {printf "\\end\{tabular\}\n"}' $1 + +# end of dat2tex |