summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/csvsimple
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-07-09 21:22:00 +0000
committerKarl Berry <karl@freefriends.org>2014-07-09 21:22:00 +0000
commit2947021b917eb9d6d2add9a432017a6569a80dd8 (patch)
treec3a0aa303e16239979360d84b1a74293a5cd1cbe /Master/texmf-dist/tex/latex/csvsimple
parentae53b1a98b3fa0ee5aaa7a183a680899ae537090 (diff)
csvsimple (8jul14)
git-svn-id: svn://tug.org/texlive/trunk@34559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/csvsimple')
-rw-r--r--Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty34
1 files changed, 21 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty b/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty
index dae90fe51cd..4712481c85d 100644
--- a/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty
+++ b/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty
@@ -1,4 +1,4 @@
-%% The LaTeX package csvsimple - version 1.10 (2014/07/07)
+%% The LaTeX package csvsimple - version 1.11 (2014/07/08)
%% csvsimple.sty: Simple LaTeX CSV file processing
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{csvsimple}[2014/07/07 version 1.10 LaTeX CSV file processing]
+\ProvidesPackage{csvsimple}[2014/07/08 version 1.11 LaTeX CSV file processing]
\RequirePackage{pgfkeys,ifthen}
@@ -137,11 +137,6 @@
\@csv@scanline%
}
-
-% default preprocessor (no preprocessing)
-\def\csv@no@preprocessor#1#2{\let#2=#1\relax}
-
-
\def\csv@preprocessor@csvsorter#1#2#3#4{%
\begingroup%
\catcode`\"=13%
@@ -149,6 +144,16 @@
\endgroup%
}
+\def\csv@preprocss@none{%
+ \let\csv@input@filename=\csv@filename%
+}
+
+\def\csv@preprocss@procedure{%
+ \csv@preprocessor{\csv@filename}{\csv@ppfilename}%
+ \let\csv@input@filename=\csv@ppfilename%
+}
+
+
%---- the loop
\def\csv@AtEndLoop{\csv@addto@macro\@endloophook}
@@ -183,7 +188,10 @@
% head line
\def\csv@processheadline{%
\csvreadnext%
- \csv@escanline{\csvline}%
+ \if\csv@par\csvline\relax%
+ \csv@error{File '\csv@input@filename' starts with an empty line!}{}%
+ \else\csv@escanline{\csvline}%
+ \fi%
\xdef\csv@columncount{\thecsvcol}%
\setcounter{csvcol}{0}%
\loop%
@@ -269,15 +277,15 @@
\global\let\@endloophook\csv@empty%
% options
\csvset{default,every csv,#1}%
- \csv@preprocessor\csv@filename\csv@ppfilename%
+ \csv@preprocss%
\csv@set@catcodes%
\csv@prereading%
\csv@table@begin%
\setcounter{csvinputline}{0}%
% start reading
- \openin\csv@file=\csv@ppfilename\relax%
+ \openin\csv@file=\csv@input@filename\relax%
\ifeof\csv@file%
- \csv@error{File '\csv@ppfilename' not existent, not readable, or empty!}{}%
+ \csv@error{File '\csv@input@filename' not existent, not readable, or empty!}{}%
\else%
% the head line
\csv@opt@processheadline%
@@ -354,8 +362,8 @@
\csvset{%
file/.gstore in=\csv@filename,%
preprocessed file/.gstore in=\csv@ppfilename,%
- preprocessor/.gstore in=\csv@preprocessor,%
- no preprocessing/.style={preprocessor=\csv@no@preprocessor},
+ preprocessor/.code={\gdef\csv@preprocessor{#1}\let\csv@preprocss=\csv@preprocss@procedure},%
+ no preprocessing/.code={\let\csv@preprocss=\csv@preprocss@none},
column names reset/.code={\gdef\csv@columnnames{}},%
column names/.code={%
\toks0=\expandafter{\csv@columnnames}%