T-F-S / csvsimple

A LaTeX package for lightweight CSV file processing.
http://www.ctan.org/pkg/csvsimple
LaTeX Project Public License v1.3c
24 stars 5 forks source link

Allowing file paths when calling the .csv #27

Open programgirl opened 11 months ago

programgirl commented 11 months ago

I tried to use a file path, relative to my document, and received the error that the file could not be located. I'm using Texifier on MacOS. Could a native path parser be included, rather than relying on CSV-Sorter.

muzimuzhi commented 11 months ago

It seems to work with TeX Live/MacTeX on macOS.

Provided the sub directory _sub_dir exists, the following example works.

\begin{filecontents}[noheader,force]{_sub_dir/sample-csv.csv}
name,givenname,matriculation,gender,grade
Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weißbäck,Werner,34567,m,5.0
Bauer,Maria,19202,f,3.3
\end{filecontents}

\documentclass{article}
\usepackage{csvsimple}

\begin{document}
\csvautotabular{_sub_dir/sample-csv.csv}
\end{document}

If example above works with Texifier, then you may need to provide a reproducible example. Otherwise Texifier might be the cause.

T-F-S commented 11 months ago

I tried to use a file path, relative to my document, and received the error that the file could not be located. I'm using Texifier on MacOS. Could a native path parser be included, rather than relying on CSV-Sorter.

Could you be more specific, preferable with a minimal working example, where the problem is. You mentioned CSV-Sorter which is an external sorting tool and which may not be supported by Texifier. I have no experience with Texifier and cannot tell.

OliCallaghan commented 2 months ago

It seems to work with TeX Live/MacTeX on macOS.

Provided the sub directory _sub_dir exists, the following example works.

\begin{filecontents}[noheader,force]{_sub_dir/sample-csv.csv}
name,givenname,matriculation,gender,grade
Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weißbäck,Werner,34567,m,5.0
Bauer,Maria,19202,f,3.3
\end{filecontents}

\documentclass{article}
\usepackage{csvsimple}

\begin{document}
\csvautotabular{_sub_dir/sample-csv.csv}
\end{document}

If example above works with Texifier, then you may need to provide a reproducible example. Otherwise Texifier might be the cause.

I think your problem may be to do with the underscores, it seems that underscores in file paths cause issues