# [texhax] read file content as parameter until EOF?

Torsten Wagner torsten.wagner at fh-aachen.de
Mon Jun 27 19:12:20 CEST 2005

Hello everybody,

first I like to thank you for the replies of my last message (Read and
process single characters). It works fine know. Uwe Lück was right,

> ? It seems that you have an unusual understanding of "token".

Yes indeed, I assume that I'm wrecked with all this "modern" object
oriented programming languages ;) I have to learn that the TeX world is
different sometimes. (Do not shout to me but after several hours happy
TeXing it seems often to me like Texing is "ordinary" programming just
on drugs ;) )

Now let's come to my new lovely problem.

I have a file which contains the following data line by line

..

Now I like to read this file and format the input until I reached the EOF

I used roughly....

\def\formatparline#1;;#2;;#3;;{#1, #2, #3} % will be replaced by a more
complex macro

\providecommand{\createparlist}{
\newboolean{breakcond}
\setboolean{breakcond}{true}
\openin\parlistin = participants.part
\whiledo{\boolean{breakcond}}{\ifeof\parlistin\setboolean{breakcond}{false}
\else \read\parlistin to \temp \expandafter\formatparline\temp \fi}

I aspect, that the whole file will be read one by one until EOF, as I
understood, the single file-line will be written as macro to \temp like
in the same way as \def\temp{file-line}

therefore, if I use \expandafter the token \temp should be resolved to
the following line

and this should be fine to resolve the command \formatparline.
However, this is not working. TeX shout that \par end before \formatline
was finished. (I assume it didn't get all paramters)

strange effect, without the while loop TeX runs fine and resolve
\expandafter\formatparline\temp correctly.

Any suggestion how can I read the file information and use them as
parameters directly.

Torsten

--
----------------------------------------------------
Dipl.-Ing. Torsten Wagner, MSc
University of Applied Sciences Aachen (Div. Juelich)
Laboratory for Chemo- and Biosensors
Ginsterweg 1, D-52428 Juelich, Germany
Tel.: +49 2461 993215 or 612466
Fax: +49 2461 993235
Email: torsten.wagner at fh-aachen.de
and
Research Centre Juelich GmbH
Institute of Thin Films and Interfaces (ISG-2)
D-52425 Juelich
----------------------------------------------------

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html