[Tex/LaTex] Shell Escape in Miktex 2.9 for CSVsimple

csvsimplemiktexpdftexshell-escape

I am quite new to LateX and I have been trying for the past few days to do a Shell escape in Miktex 2.9/ TeXworks in my pdflatex+Makeindex+bibtex typesetter so that I could be able to use the CSVsorter presented in the CSVsimple package.

I tried the methods presented Here, and Here.

When I try to compile my tex

\csvreader[sort by=table/namesort.xml,
head to column names,
tabular=>{\color{red}}lllll,
table head=\toprule year of birth\\\midrule,
table foot=\bottomrule]
{./table/csvsimple-example.csv}{}{\csvlinetotablerow} 

I obtain this error :

sort "./table/csvsimple-example.csv" by "./table/namesort.xml">

("C:…\My tex.csvtoken"

! Package csvsimple Error: Call of CSV-Sorter failed! Use '-shell-escape' optio
n or check log file 'csvsorter.log'..

See the csvsimple package documentation for explanation.
Type H for immediate help.

l.1 …ption or check log file 'csvsorter.log'.}{}

But I have no log file to start with. So I don't know if it is a programming error or a problem to configure -shell-escape

Thank you

Best Answer

Since the command line version works for the OP, it looks like a TeXWorks setup problem.

The following additions to the TeXWorks compilation options work for me. I am sorry for german texts in the screenshots from my PC.

The first one is for setting up a pdfLaTeX compile option with --shell-escape:

enter image description here

The second one is for a pdfLaTeX+MakeIndex+BibTeX compile option with --shell-escape:

enter image description here

With both settings the example from http://t-f-s.github.io/csvsorter/ compile.

Prerequisite is that the CSVsorter program is found on the system path. Putting it into the source directory of the LaTeX example also works.

The files for the example are the following:

songcontest.tex:

\documentclass{article}
\usepackage{array,booktabs,csvsimple}
\usepackage{geometry}
\begin{document}

\csvreader[sort by=sumsort.xml,
  head to column names,
  tabular=lllcc,
  table head=\toprule\textbf{Artist} & \textbf{Title} & \textbf{Country} &
             \textbf{Points} & \textbf{TV+JV}\\\midrule,
  table foot=\bottomrule]
{songcontest.csv}{}
{\Artist & \itshape''\Title'' & \Country &
 \bfseries\the\numexpr\Televote+\Juryvote\relax & $(\Televote+\Juryvote)$}

\end{document}

songcontest.csv:

Title,Artist,Country,Televote,Juryvote
La la la la la,The Singers,United Kingdom,25,62
One and two and three,Hansi Unterober,Germany,47,35
Rarara,Channel Rats,Grand Fenwick,12,14
The green hills of the shire,Frodo and Friends,New Zealand,76,45
Paris e Calais,Chantal and Pascal,France,47,41
The bell rings,Baab,Sweden,87,24

sumsort.xml:

<?xml version="1.0" encoding="UTF-8"?>
<csv>
  <sortlines>
    <sum order="descending" type="integer">
      <column name="Televote"/>
      <column name="Juryvote"/>
    </sum>
    <column name="Country" order="ascending" type="string"/>
  </sortlines>
</csv>

My example directory contains the following files:

enter image description here