# csvsimple and tabular produces garbage

A simple example:

\documentclass[12pt]{article}
\usepackage{csvsimple}
\begin{document}
\begin{tabular}{|c|c|}
\end{tabular}
\end{document}


The test.csv file:

foo|bar|baz|
foo|bar|baz|


It should be one line but the first two vertical rules are longer than the table.

What's wrong? How can I fix it?

EDIT Ruixi's answer doesn't work the following case. The adatok.csv file:

vara|varb|varc|vard|vare|
foo|bar|baz|foox|fooy|
foo2|bar2|baz2|foofoo|bazbar|


The LaTeX-file:

\documentclass[landscape,12pt]{article}
\usepackage{csvsimple}
\begin{document}
\begin{tabular}{|l|c|c|c|c|}
\end{tabular}
\end{document}


I don’t think I fully understand your question. But removing the \\ seems to solve your problem:

\documentclass[12pt]{article}
\usepackage{tcolorbox}
\usepackage{csvsimple}
\begin{document}
\begin{tcbverbatimwrite}{test.csv}
foo|bar|baz|
foo|bar|baz|
\end{tcbverbatimwrite}
\begin{tabular}{|c|c|}
\end{tabular}
\end{document}


\documentclass[12pt]{article}
\usepackage{tcolorbox}
\usepackage{csvsimple}
\begin{document}
\begin{tcbverbatimwrite}{test.csv}
vara|varb|varc|vard|vare|
foo|bar|baz|foox|fooy|
foo2|bar2|baz2|foofoo|bazbar|
\end{tcbverbatimwrite}
\begin{tabular}{|l|c|c|c|c|}
\hline

• @uzsolt Using late after line={\\[1cm]\hline} should work. The curly braces are needed to secure the option setting. – Thomas F. Sturm Sep 11 '18 at 12:44