# Shell Escape in Miktex 2.9 for CSVsimple

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,
tabular=>{\color{red}}lllll,
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

• Have you been able to do the command line example from t-f-s.github.io/csvsorter ? That's everything between Example and Example (continued for LaTeX). If that does not work, the problem is, maybe, the Java installation and not LaTeX. – Thomas F. Sturm Mar 18 '15 at 7:12
• CSVsorter works (I tried Example has ask) but I tried calling the csvsorter in latex has in the example (continued for LateX) and it didn't I received this log : <sort "songcontest.csv" by "./sumsort.xml"> runsystem(csvsorter -c "./sumsort.xml" -l "csvsorter.log" -t "csvcmdex.csvtoken " -i "songcontest.csv" -o "csvcmdex_sorted._csv" -q 1)...disabled (restricted). ("C:\Users\Simon.Aperture\Desktop\Test latex\cvs cdmex\csvcmdex.csvtoken" ! Package csvsimple Error: Call of CSV-Sorter failed! Use '-shell-escape' optio n or check log file 'csvsorter.log'.. – Simon Boucher Mar 19 '15 at 3:08

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:

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

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}

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:

• I Tried exactly what you did and it worked but insode my main document it didn't. y file construction is a main tex file, and the xml and csv inside a seperate foleder named table – Simon Boucher Mar 19 '15 at 16:35
• If it can help or change something, I can try to use winedt. Also I use the memoir class. – Simon Boucher Mar 19 '15 at 18:00
• @SimonBoucher If my answer worked for you, the question about 'shell escpae in MikTeX' is solved. There has to be some programming error in your main file, I guess. To get help in this matter, you should file a new question with a MWE which allows to reconstruct the problem. – Thomas F. Sturm Mar 20 '15 at 7:02