I'm trying to use csvsimple to read in a file with elements that contain special characters (underscores in this example) and create a table that only has a some of the columns. I can read in the file (test.csv below) and produce a table of its contents using auto tabular and the 'respect all' option (This works). However when I try do create the table with specific column names, the 'respect all' option doesn't seem to work. Bot examples below work if I remove the underscores from the csv file. Do I need to place the contents of \a into some type of verbatim environment?
\documentclass[]{article}
\usepackage{csvsimple}
\usepackage{booktabs}
\usepackage[T1]{fontenc}
\begin{document}
% This works
\csvreader[%
respect all,%
autotabular%
]{test.csv}{}{\csvlinetotablerow}%
% This does not
\begin{tabular}{|l|c|}\hline%
\bfseries Col A & \bfseries Col B
\csvreader[%
respect all,%
head to column names
]{test.csv}{}%
{\\\a & \b}%
\\\hline
\end{tabular}
\end{document}
test.csv:
a,b,c,d
b_1,2,3,4
b_5,6,7,8
b_9,10,11,12