I'm using csvsimple to import some columns from a csv file into a tabular environment. The CSV file contains a column where all the values are dollar amounts, so just including it directly gives errors like the following:
Extra }, or forgotten $. ...tNum & \Reference & \UnitPriceAtOneKUnits}
After reading through the manual for csvsimple, I found there are respect commands that should be able to be added. However it doesn't seem to respect either the respect dollar or respect all options. I've also tried respect dollar=true, respect all=true, /csv/respect dollar=true, and /csv/respect all=true. I don't mind if it respects all since I'm not planning on putting LaTeX in any of the fields - I just want it to display the data for the selected columns.
Here is a complete example showing the issue:
\documentclass[12pt,letterpaper,landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in,bottom=1in,top=1in]{geometry}
\usepackage{csvsimple}
\begin{document}
\begin{table}[h]
\begin{tabular}{c|l|l|l|r}%
\bfseries Qty & \bfseries Part Description & \bfseries Manufacturer Part \# & \bfseries Reference & \bfseries Unit Price At 1K Units
\csvreader[respect dollar,head to column names,separator=pipe]{BOM.csv}{}%
{\\\hline\Qty & \PartDescription & \ManufacturerPartNum & \Reference & \UnitPriceAtOneKUnits}%
\end{tabular}
\end{table}
\end{document}
Here is some sample data for the csv file (with only revelant columns):
I'm using csvsimple to import some columns from a csv file into a tabular environment. The CSV file contains a column where all the values are dollar amounts, so just including it directly gives errors like the following:
Extra }, or forgotten $. ...tNum & \Reference & \UnitPriceAtOneKUnits}
Missing $ inserted. ...tNum & \Reference & \UnitPriceAtOneKUnits}
Missing } inserted. ...tNum & \Reference & \UnitPriceAtOneKUnits}
After reading through the manual for csvsimple, I found there are
respect
commands that should be able to be added. However it doesn't seem to respect either therespect dollar
orrespect all
options. I've also triedrespect dollar=true
,respect all=true
,/csv/respect dollar=true
, and/csv/respect all=true
. I don't mind if it respects all since I'm not planning on putting LaTeX in any of the fields - I just want it to display the data for the selected columns.Here is a complete example showing the issue:
Here is some sample data for the csv file (with only revelant columns):
Software Versions:
Note, this was also posted on SO, no solution was found, and they recommended submitting a bug report.