# Add vertical line to csv simple table

I cannot figure out how to modify the Code given in this post in order to create an horizontal line over the last entry of the last column. That means I want the table to look like this (please excuse my bad drawing ;)):

Thank you

• While it might be possible to hack something in that direction, I am not sure whether CSV is actually the right tool to accomplish this. CSV has merely a definition of a "header" row. Maybe using one of the tabular* packages is the easier way to go here. – languitar Sep 15 '16 at 11:03

You could do something like

late after line=\ifnumequal{\thecsvrow}{3}{\\\midrule}{\\},


too add a rule at a certain line.

The full source code is:

\documentclass{article}

\usepackage{csvsimple,booktabs}

% csv file
Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weisbaeck,Werner,34567,m,5.0
\end{filecontents*}

\begin{document}
tabular=ccccc,
late after line=\ifnumequal{\thecsvrow}{3}{\\\midrule}{\\},
late after last line=\\,
table foot=\bottomrule,
]
{\name & \givenname & \matriculation & \gender & \grade}
\end{document}


Update:

To use a dashed line, the arydshln package may be used which provides \hdashline. I have no experience with that package, but the following seems to work:

\documentclass{article}

\usepackage{csvsimple,booktabs,arydshln}

% csv file
Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weisbaeck,Werner,34567,m,5.0
\end{filecontents*}

\begin{document}
tabular=ccccc,
late after line=\ifnumequal{\thecsvrow}{3}{\\\hdashline}{\\},
late after last line=\\,
table foot=\bottomrule,