🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #10473

TeX guru help needed

#10473
From: Daniel Pfeiffer
Date: Tue, 25 Jun 1991 10:16
41 lines
1818 bytes
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>
 |
Technical Details
Message-ID: <PFEIFFER.91Jun25101651@cix.cict.fr>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!sdd.hp.com!wuarchive!uunet!mcsun!corton!cix!pfeiffer

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!sdd.hp.com!wuarchive!uunet!mcsun!corton!cix!pfeiffer
From: pfeiffer@cix.cict.fr (Daniel Pfeiffer)
Newsgroups: comp.text.tex
Subject: TeX guru help needed
Keywords: \loop \par
Message-ID: <PFEIFFER.91Jun25101651@cix.cict.fr>
Date: 25 Jun 91 10:16:51 GMT
Sender: news@cix.cict.fr
Distribution: comp
Organization: /users/deamlad/pfeiffer/.organization
Lines: 41