I just wanted to format a .csv
file, so I do a test (1), shown as below:
\global\let\xpar=\par
\def\format#1,#2,#3\par{$#1\times #2=#3$\xpar}
\begingroup
\everypar={\format}\obeylines%
11,2,22
13,9,117
a,b,c
\endgroup
\end
but it doesn't work, TeX complain that
! File ended while scanning use of \format.
<inserted text>
\par
so I remove \obeylines
, do another test (2):
\global\let\xpar=\par
\def\format#1,#2,#3\par{$#1\times #2=#3$\xpar}
\begingroup
\format 11,2,22
\format 13,9,117
\format a,b,c
\endgroup
\end
it works fine. Who can tell me where is wrong is test (1)?