# csv string to table without external files

I'm trying to create a Latex table from a CSV string. I saw a similar question , after which I started playing around with the csvsimple package (manual).

What I don't understand is the need for filecontents. When something like

\usepackage{csvsimple}
\usepackage{filecontents}

\begin{filecontents*}{example.csv}
foo,bar,baz
zip,boom,bang
\end{filecontents*}

\csvautotabular{example.csv}


is run, this creates a file on disk called example.csv. Is there a way to parse CSV from the string itself?

\csvautotabular{\mymacro}


doesnt fly either.

• You don't need the filecontents environment to parse CSV files. The filecontents is only used to show the example. Sep 23, 2014 at 15:40
• How do you define \mymacro? Sep 23, 2014 at 16:39
• \mymacro would have just expanded to a comma-separated string, e.g. a,b,c,d . In any case, this seems to be a limitation of csvsimple, so for now I explicitly made files for all my csv strings.
– icy
Sep 23, 2014 at 20:56