From f286e2623a5a136eba00264aab46036673fcf310 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 8 Jun 2021 20:36:09 +0000 Subject: csvsimple (8jun21) git-svn-id: svn://tug.org/texlive/trunk@59521 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/csvsimple/csvsimple.sty | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/tex/latex/csvsimple') diff --git a/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty b/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty index ed4b83b1c37..98d1a328668 100644 --- a/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty +++ b/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty @@ -1,8 +1,8 @@ -%% The LaTeX package csvsimple - version 1.21 (2019/04/09) +%% The LaTeX package csvsimple - version 1.22 (2021/06/07) %% csvsimple.sty: Simple LaTeX CSV file processing %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2019 by Prof. Dr. Dr. Thomas F. Sturm +%% Copyright (c) 2008-2021 by Prof. Dr. Dr. Thomas F. Sturm %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -18,7 +18,7 @@ %% This work consists of all files listed in README %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{csvsimple}[2019/04/09 version 1.21 LaTeX CSV file processing] +\ProvidesPackage{csvsimple}[2021/06/07 version 1.22 LaTeX CSV file processing] \RequirePackage{pgfrcs,pgfkeys,ifthen,etoolbox,shellesc} @@ -182,9 +182,9 @@ % auto head names \def\set@csv@autohead{% - \toks0=\expandafter{\csname\csv@current@col\endcsname}% + \toks0=\expandafter{\csname\csv@headnameprefix\csv@current@col\endcsname}% \toks1=\expandafter{\csname csvcol\romannumeral\c@csvcol\endcsname}% - \edef\csv@temp{\noexpand\gdef\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\noexpand\gdef\the\toks0{}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\gdef\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\noexpand\gdef\the\toks0{}}}% \csv@temp% } @@ -192,16 +192,16 @@ \def\set@csv@head{% \toks0={\gdef##1}% \toks1=\expandafter{\csname csvcol\romannumeral\c@csvcol\endcsname}% - \edef\csv@temp{\noexpand\pgfkeysdef{/csv head/\csv@current@col}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\pgfkeysdef{/csv head/\csv@current@col}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% \csv@temp% - \edef\csv@temp{\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% \csv@temp% } % head line \def\csv@processheadline{% \csvreadnext% - \if\csv@par\csvline\relax% + \ifx\csv@par\csvline\relax% \csv@error{File '\csv@input@filename' starts with an empty line!}{}% \else\csv@escanline{\csvline}% \fi% @@ -222,7 +222,7 @@ \def\set@csv@nohead{% \toks0={\gdef##1}% \toks1=\expandafter{\csname csvcol\romannumeral\c@csvcol\endcsname}% - \edef\csv@temp{\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% \csv@temp% } @@ -281,7 +281,7 @@ \stepcounter{csvinputline}% } -\let\csv@par=\par +\def\csv@par{\par} % reads and processes a CSV file \long\def\csvloop#1{% @@ -329,7 +329,7 @@ \global\let\csv@next=\csv@empty% \else% \global\let\csv@next=\csv@iterate% - \if\csv@par\csvline\relax% + \ifx\csv@par\csvline\relax% \else% \csv@escanline{\csvline}% % check and decide @@ -395,6 +395,7 @@ \pgfkeysalso{check column count}},% head/false/.code={\global\let\csv@opt@processheadline=\csv@noheadline% \pgfkeysalso{check column count=false,late after head=}},% + head to column names prefix/.store in=\csv@headnameprefix,% head to column names/.is choice,% head to column names/.default=true,% head to column names/true/.code={\global\let\csv@opt@headtocolumnames=\set@csv@autohead},% @@ -456,6 +457,7 @@ command=\csvline, column names reset, head, + head to column names prefix=, head to column names=false, column count=10, on column count error=, -- cgit v1.2.3