need fast parser for comma/space delimited numbers

Les Schaffer godzilla at netmeg.net
Sun Mar 19 20:28:23 CET 2000


Mike Miller said:

> TableIO [1] does exactly what you're looking for and is reasonably
> fast I think.  It is a C extension for reading data from ascii
> files.  Rather than using scanf, it uses fgets and strtok to parse
> lines.  It also allows you to flag certain lines as "comment" lines
> by skipping any lies containing a specified character.

thanks, i'll take another look.

one issue for me is that my data files have some text at the top which
the test instrument spits out. so i would need to specify where in the
file the data starts.

also, i had looked at your module before. it was clear to me how to
specify comma-separated vs. whitespace separated.

finally, is it possible for your module to have the first column of
data be int's and the rest floats (though this is not absolutely
critical, it would be useful in certain circumstances).

les schaffer



More information about the Python-list mailing list