🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #10480

Re: TeX guru help needed

#10480
From: Rainer Schoepf
Date: Tue, 25 Jun 1991 20:38
47 lines
2091 bytes
In article <PFEIFFER.91Jun25101651@cix.cict.fr> pfeiffer@cix.cict.fr (Daniel Pfeiffer) writes:
>I want to read and parse every line in a file that contains no
>empty lines:
>
>	\openin\@std \bookname.sind
>	\loop
>		\read\@std to\@theline
>		\ifx\@theline\par\encorefalse\fi
>	\ifencore
>		\expandafter\@parse\@theline
>		\ifx\@theword\@theoldword
>			\ifx\@thepage\@theoldpage\else, \@thepage\fi
>		\else
>			\relax\endgraf\@theword\@dots\@thepage
>			\let\@theoldword=\@theword
>		\fi
>		\let\@theoldpage=\@thepage
>	\repeat
>
>I read from a file whose lines are all uniform, and recognized by \@parse.
>When I get to the end of the file the value of \@theline is \par.  So I
>figured I'd test for the end with \ifx\@theline\par.  Problem is that
>\loop tries to read everything upto \repeat but falls flat on it's face
>when it sees the \par.  How do I make \par symbolic rather than a paragraph
>separator.  I've tried \let\@par=\par but then the test \ifx\@theline\@par
>fails.  Putting an \outer before \loop doesn't change anything.
>
>How do I correct this???  Alternate solutions to parsing every line
>in a file are also welcome!
>
> +---------------+
> |     * * *     |
> |   *       *   |	Beware - polyglot esperantist
> |  *         *  |
> |   *       *   |
> |     * * *     |
> +---------------+
> |
> |  Daniel Pfeiffer				<pfeiffer@cix.cict.fr>
> |  Tolosa (Toulouse), Midi-Pyrenees, Europe	<pfeiffer@irit.fr>
> |						<pfeiffer@frcict81.bitnet>
> |


How about testing for end-of-file with the \ifeof primitive?

Rainer Sch"opf
Technical Details
Message-ID: <1991Jun25.203859.6701@rusmv1.rus.uni-stuttgart.de>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!csl!fernwood!uunet!mcsun!unido!ira.uka.de!rusmv1!texinfo1
References: <PFEIFFER.91Jun25101651@cix.cict.fr>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!csl!fernwood!uunet!mcsun!unido!ira.uka.de!rusmv1!texinfo1
From: texinfo1@rusmv1.rus.uni-stuttgart.de (Rainer Schoepf)
Newsgroups: comp.text.tex
Subject: Re: TeX guru help needed
Keywords: \loop \par
Message-ID: <1991Jun25.203859.6701@rusmv1.rus.uni-stuttgart.de>
Date: 25 Jun 91 20:38:59 GMT
References: <PFEIFFER.91Jun25101651@cix.cict.fr>
Distribution: comp
Organization: Comp.Center (RUS), U of Stuttgart, FRG
Lines: 47