Path: 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: Date: 25 Jun 91 10:16:51 GMT Sender: news@cix.cict.fr Distribution: comp Organization: /users/deamlad/pfeiffer/.organization Lines: 41 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 | Tolosa (Toulouse), Midi-Pyrenees, Europe | |