Re: parsing a dbIII file
- From: Steve Holden <steve@xxxxxxxxxxxxx>
- Date: Tue, 07 Aug 2007 03:21:37 -0400
korovev76@xxxxxxxxx wrote:
Hello everybody, I'm new to python (...I work with cobol...)That's not a standard dBaseIII data file though, correct? It looks more like something that was produced *from* a dBaseIII file.
I have to parse a file (that is a dbIII file) whose stucture look like
this:
|string|, |string|, |string that may contain commas inside|, 1, 2, 3, |
other string|
Is there anything in python that parses this stuff?
thanks a lot
korovev
If the format is similar to Excel's CSV format then the csv module from Python's standard library may well be what you want. Otherwise there are parsers at all levels - one called PyParsing is quite popular, and I am sure other readers will have their own suggestions.
I am not sure whether the pipe bars actually appear in your data file, so it is difficult to know quite exactly what to suggest, but I would play with the file in an interactive interpreter session first to see whether csv can do the job.
Good luck with your escape from COBOL!
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
.
- Follow-Ups:
- Re: parsing a dbIII file
- From: Paul McGuire
- Re: parsing a dbIII file
- From: korovev76
- Re: parsing a dbIII file
- References:
- parsing a dbIII file
- From: korovev76
- parsing a dbIII file
- Prev by Date: parsing a dbIII file
- Next by Date: Re: help with flexible decorators
- Previous by thread: parsing a dbIII file
- Next by thread: Re: parsing a dbIII file
- Index(es):
Relevant Pages
|