Mainpulating Data Files

Tim Daneliuk tundra at tundraware.com
Sun Jul 22 20:20:02 CEST 2001


Say, for the sake of argument, I have a bunch of data files in some
"alien" format (not Berkeley DB, CSV, or any of the other well-known
data formats).  Say I know the format and it consists of both ASCII and binary
data in fixed record-field, variable-length record-field, and arbitrary variable
length data.  Some of the data might be in AVL or B-Tree format with embedded
linking information in each record.

So, as a general matter, is there a 'Pythonic' way to read this kind of
thing in or am I stuck with the usual 'C' approach of reading in n-characters
and then filling some data stucture?  I guess what I am really asking is
where there is some Python-enabled templating approach that allows me to
describe the schema of a file in some meta-data format, and then use
Python to read it in and manipulate it.  I vaguely understand that this
might be possible using something like XML, but I was thinking more about
a language feature like picture fields in perl.

TIA, (as always) 
-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com



More information about the Python-list mailing list