<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% Do not read this file twice.
\ifdefined\tsvloaded\expandafter\endinput\fi
\chardef\tsvloaded\catcode`\&amp; \catcode`\&amp;=11

% Implement a tsv reader.
\long\def\applytemplate#1#2#3#4{\begingroup\openin\&amp;r#4
  \def\&amp;w##1##2{\errmessage{#4: ##1 fields at line \the\&amp;o\space
  (##2 discarded)}}\catcode`#112 \errorcontextlines0 \ifx\&amp;z#2\&amp;z
    {\catcode`\ 9 \global\read\&amp;r to\&amp;f}\else {\catcode`\,13
    \&amp;e\edef\scantextokens{,}{\Uchar`#1}\global\&amp;d{&amp;f}{#2}}\fi
    \&amp;e\&amp;b\Uchar`#1{#3}}
\long\def\&amp;d#1#2{\&amp;e\edef\csname#1\endcsname{\scantextokens{#2}}}
\let\&amp;e\expandafter\newcount\&amp;o\newcount\&amp;p\def\&amp;q{\par}\newread\&amp;r\def\&amp;z{\&amp;z}
\def\&amp;s#1{\&amp;w{Not enough}{line}} \def\&amp;t#1\&amp;z#2{\&amp;w{Too many}{fields}}
\def\&amp;a#1{\advance#11 } \long\def\&amp;b#1#2{\&amp;o0 \&amp;p0
  \def\&amp;x##1#1{\ifx\&amp;z##1\&amp;z\let\&amp;x\relax\else\&amp;a\&amp;p\&amp;d{&amp;\the\&amp;p}{##1}\fi\&amp;x}%
  \&amp;e\&amp;x\&amp;f#1#1\chardef\&amp;m\&amp;p \long\def\&amp;x##1#1{\&amp;a\&amp;p \ifx\&amp;z##1\&amp;e\&amp;s\else
    \&amp;d{\csname &amp;\the\&amp;p\endcsname}{##1}\ifnum\&amp;p=\&amp;m\&amp;e\&amp;y\fi\fi\&amp;x}%
  \long\def\&amp;y\fi\&amp;x##1#1{\fi{#2}\ifx\&amp;z##1\relax\else\&amp;e\&amp;t\fi}\&amp;p0
  \def\&amp;n{\read\&amp;r to\&amp;l \ifx\&amp;q\&amp;l\closein\&amp;r\let\&amp;n\relax
    \else\&amp;a\&amp;o{\&amp;e\&amp;x\&amp;l#1\&amp;z#1}\fi\&amp;n}\&amp;n\endgroup}

% A shorthand for Plain \TeX.
\def\tsvtemplate{\futurelet\&amp;px\&amp;pa}
\def\&amp;pc{\&amp;pb[]}\def\&amp;pb[#1]{\applytemplate\^^I{#1}}
\def\&amp;pa{\ifx\&amp;px[\&amp;e\&amp;pb\else\&amp;e\&amp;pc\fi}
\catcode`\&amp;=\tsvloaded
</pre></body></html>