[pstricks] Generate Table via \readdata

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Apr 21 08:58:10 CEST 2009

Buddy Ledger schrieb:
> Thanks Herbert, works great.  How would I include a \hline command to 
> produce the row separation lines?  the code below gives a misplaced 
> \noalign error.

I am a bit lost here ... :-( don't know why the last column
appears. Maybe others can have a look, what'S going wrong.


\usepackage{filecontents}% allows overwriting
1.00E+001 2.00E+001 3.00E+001 4.00E+001
2.00E+001 3.00E+001 4.00E+001 5.00E+001
3.00E+001 4.00E+001 5.00E+001 6.00E+001
4.00E+001 5.00E+001 6.00E+001 7.00E+001

\def\checkEntries#1 #2#3\@nil{%
    \global\advance\pst at cnta\@ne%
  \read1 to \pst at tempa
  \global\pst at cnta=0
  \expandafter\checkEntries\pst at tempa\space\@nil
  \advance\pst at cnta\@ne
  \gdef#2{\the\pst at cnta}\ignorespaces}

\def\fillTab at i#1{\fillTab at ii#1}
\def\fillTab at ii D #1 {%
  \global\advance\pst at cntm by \@ne
  \ifnum\pst at cntm>\dataNo
    \global\pst at cntm=\@ne
    \\\hline \else & \fi
  \@ifnextchar D\fillTab at ii{}}
  \global\pst at cntm=\@ne
  \expandafter\fillTab at i#1}

the data:\\



More information about the PSTricks mailing list