Reading plain text file database tables
Li Dongfeng
mavip5 at inet.polyu.edu.hk
Thu Sep 9 02:15:38 EDT 1999
Do we have a module to read plain text file
database tables?
All the data management software, e.g. excel,
dBase, SAS, etc., support input/output a table
from/to a plain text file, fields can be separated
by their column position, by spaces, by tabs,
by commas, etc.
How can we read this kind of file into a matrix like
structure(list of lists)? I have written one reading
files with fixed-width fields. For delimited files,
simply using string.split work most of the time, but
fails reading lines like
"Peter Thomson" 25 36
or even
"Peter\" Thomson" 25 36
I think this is a common task, so maybe someone has
already given a very good solution.
Li Dongfeng
More information about the Python-list
mailing list