# csvsimple and more filters

how do I use csvsimple (or what else? pgfplotstable?) with more than 1 condition as filter (i need about 7) to show a filtered csv-file as table? I tried things like:

filter=\equal{\gender}{m} and \equal{\grade}{5.0}


but that does not work. Example see below. Thanks.

\documentclass{article}
\usepackage{csvsimple}
\usepackage{filecontents}

\begin{filecontents*}{testdata.csv}
name,gender,grade
Hans,m,1.0
Anna,f,2.3
Anton,m,5.0
Hilde,f,5.0
\end{filecontents*}

\begin{document}

\begin{tabular}{lc}
\csvreader[head to column names,filter=\equal{\gender}{m}]{testdata.csv}{}
{\\\name & \grade}
\end{tabular}

\begin{tabular}{lc}
\csvreader[head to column names,filter=\equal{\grade}{5.0}]{testdata.csv}{}
{\\\name & \grade}
\end{tabular}

\begin{tabular}{lc}
\csvreader[head to column names,filter=\equal{\gender}{m} and \equal{\grade}{5.0]{testdata.csv}{}
{\\\name & \grade}
\end{tabular}

\end{document}

-

## 1 Answer

the package seems to use ifthenelse internally so you can use that package's boolean expressions involving \and and \or.

So I just changed one line to:

\csvreader[head to column names,filter=\equal{\gender}{m} \and \equal{\grade}{5.0}]{testdata.csv}{}

-
Thank you..... :) – Daniel Jul 6 '12 at 20:50