I have to import a csv table whose entries contain underscores. A simple example is the following table:
FirstCol, SecondCol
Item_A, Item_B
I am trying to solve my problem with the csvsimple
package with the "respect underscore=true" option. Here is a minimal working example:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{longtable}
\usepackage{csvsimple}
\usepackage{array,booktabs}
\usepackage[T1]{fontenc}
\begin{document}
\begin{longtable}{|l|l|}
\hline
\csvreader[respect underscore=true, head to column names,
late after line=\\\hline]{Test.csv}{}{\FirstCol & \SecondCol}
\end{longtable}
\end{document}
This code produces the following result:
How do I get rid of the obviously wrong column separators just below the table? To be clear, what I would like is this:
Note that the two separators only appear if the "respect underscore=true" option is present. If I remove this option (and delete the underscores from the input file), then all works as expected.
Best Answer
A solution could be
pgfplotstable
with theverb string type
option.