12.07.2015 Views

Manual for the csvsimple package

Manual for the csvsimple package

Manual for the csvsimple package

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Alternatively, column names can be set by \csvnames → P. 8 and style definitions by\csvstyle → P. 8 . With this, <strong>the</strong> last example is rewritten as follows:\csvnames{myNames}{1=\name,2=\firstname,3=\matnumber,5=\grade}\csvstyle{myStudentList}{tabular=|r|l|c|,table head=\hline & Person & #1\\\hline\hline,late after line=\\\hline, myNames}\csvreader[myStudentList={Matr.~No.}]{grade.csv}{}%{\<strong>the</strong>csvrow & \firstname~\name & \matnumber}%\hfill%\csvreader[myStudentList={Grade}]{grade.csv}{}%{\<strong>the</strong>csvrow & \firstname~\name & \grade}%PersonMatr. No.1 Hans Maier 123452 Anna Huber 234563 Werner Weißbäck 34567PersonGrade1 Hans Maier 1.02 Anna Huber 2.33 Werner Weißbäck 5.0The data lines of a CSV file can also be filtered. In <strong>the</strong> following example, a certificate is printedonly <strong>for</strong> students with grade unequal to 5.0.\csvreader[filter not equal={\grade}{5.0}]%{grade.csv}{1=\name,2=\firstname,3=\matnumber,4=\gender,5=\grade}%{\begin{center}\Large\bfseries Certificate in Ma<strong>the</strong>matics\end{center}\large\if<strong>the</strong>nelse{\equal{\gender}{f}}{Ms.}{Mr.}\firstname~\name, matriculation number \matnumber, has passed <strong>the</strong> testin ma<strong>the</strong>matics with grade \grade.\par\ldots\par}%Certificate in Ma<strong>the</strong>maticsMr. Hans Maier, matriculation number 12345, has passed <strong>the</strong> test in ma<strong>the</strong>maticswith grade 1.0.. . .Certificate in Ma<strong>the</strong>maticsMs. Anna Huber, matriculation number 23456, has passed <strong>the</strong> test in ma<strong>the</strong>maticswith grade 2.3.. . .5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!