[texhax] A question

Philip Taylor P.Taylor at Rhul.Ac.Uk
Sat Sep 10 13:10:03 CEST 2016



nhoseini at uk.ac.ir wrote:
>
> Hi: I am reading a file line to \a. Then \a is a string such as "aaa bbbb 4 5 34.5". I would like to read the parts "aaa" and "bbbb" to new strings and the numbers 4, 5, etc, to number variables. Would you please help me to do that. Thanks.
>

\newcount \counta
\newcount \countb

\def \parsea #1 #2 #3 #4 #5\relax
    {%
        \def \stringa {#1}%
        \def \stringb {#2}%
        \counta = #3
        \countb = #4
        \message {I don't know what to do with #5 because it contains a decimal point}%
    }

\expandafter \parsea \a \relax

/Caveat lector -- /*untested*/./

Philip Taylor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20160910/721112a0/attachment-0001.html>


More information about the texhax mailing list