[Tugindia] Script to tabulate data.

H S Rai hsraidce at iitr.ernet.in
Wed Jun 4 14:04:11 CEST 2003

I  wrote  a  small  script  (see below  signature)  to  tabulate  data
available as space or tab separated columns (Normally result file of a
program). I  am posting  it  with the  aim that  someone  may find  it
useful. or someone  may suggest some better way to  write such script.
I used `k' as  pot variable to do what I wanted, as  with my very poor
knowledge of scripting, I could not do without that :-(

$ tabulate foo.out

It will produced foo.out.tex file.


 Put in a executable filename  `tabulate'
cat $1 |tr '\t' " " | tr -s " " | tr -s '\n'| tr -s '\t' |\
tr '\n' 'k'| \
sed 's/ /t\& /g' | sed 's/k/\\\\ \\hline k/g' | \
tr 't' '\t' | \
tr 'k' '\n' > $1.tex

More information about the Tugindia mailing list