csvsimple 没有页面输出

csvsimple 没有页面输出

以下使用 tex 源csvsimple不会产生任何输出:

\documentclass[a4paper,11pt]{article}
\usepackage{csvsimple}

\begin{document}
\csvreader[head to column names,separator=semicolon]{test.csv}{}
          {\LASTNAME \\}
\end{document}

test.csv的内容:

UID;CASID;USERNAME;LASTNAME;FIRSTNAME;MAIL;VALID;CIV;MIDDLENAME;URL;LANGUEID;PHONE;FAX;DATE;Arrival date;Departure date;Number of accompanying persons;Institution;Mailing Address;Country of organization;Laboratory;STATUS
1;1;user;doe;joe;[email protected];;;;;;;;;;;;college;;;;;

pdflatex 的日志:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux) (preloaded format=pdflatex 2019.8.25)  28 SEP 2019 08:40
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**test.tex
(./test.tex
LaTeX2e <2018-12-01>
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texmf-dist/tex/latex/csvsimple/csvsimple.sty
Package: csvsimple 2016/07/01 version 1.20 LaTeX CSV file processing

(/usr/share/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
\pgfkeys@pathtoks=\toks14
\pgfkeys@temptoks=\toks15

(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
\pgfkeys@tmptoks=\toks16
)))
(/usr/share/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
(/usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2018/08/19 v2.5f e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count88
)
(/usr/share/texmf-dist/tex/latex/tools/shellesc.sty
Package: shellesc 2016/06/07 v0.02a unified shell escape interface for LaTeX
Package shellesc Info: Restricted shell escape enabled on input line 69.
)
\csv@file=\read1
\c@csvinputline=\count89
\c@csvrow=\count90
\c@csvcol=\count91
\csv@out=\write3
)
No file test.aux.
\openout1 = `test.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
(./test.aux) ) 
Here is how much of TeX's memory you used:
 1584 strings out of 492623
 32925 string characters out of 6135669
 93181 words of memory out of 5000000
 5559 multiletter control sequences out of 15000+600000
 3940 words of font info for 15 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 40i,1n,46p,770b,36s stack positions out of 5000i,500n,10000p,200000b,80000s

No pages of output.
PDF statistics:
 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

答案1

问题在于test.csv文件的格式。条目包含一个额外的结尾;。要解决这个问题,可以

--在标题中添加一个额外字段

UID;CASID;USERNAME;LASTNAME;FIRSTNAME;MAIL;VALID;CIV;MIDDLENAME;URL;LANGUEID;PHONE;FAX;DATE;Arrival date;Departure date;Number of accompanying persons;Institution;Mailing Address;Country of organization;Laboratory;STATUS;extra
    1;1;user;doe;joe;[email protected];;;;;;;;;;;;college;;;;;

--删除;条目末尾的

UID;CASID;USERNAME;LASTNAME;FIRSTNAME;MAIL;VALID;CIV;MIDDLENAME;URL;LANGUEID;PHONE;FAX;DATE;Arrival date;Departure date;Number of accompanying persons;Institution;Mailing Address;Country of organization;Laboratory;STATUS
1;1;user;doe;joe;[email protected];;;;;;;;;;;;college;;;;

相关内容