Splitting a string with extra parameters

Chris P mxchrisp at gmail.com
Wed Apr 5 23:23:01 EDT 2006


Hello list,

I just started using python and I must say I enjoy it very much.

I do have an issue in which I hope to get some pointers to.

I have a string, which I need to split based on a delimiter. This I know how
to do. But what I cannot figure out is, take for example the following:

"column 1 data", "column 2 data", "column price $2,020", "column 4 data"

when splitting based on a delimiter of "," the above string gets broken up
in 5 "columns" instead of 4 due to the "," in the money amount.

how can I say:

split string on "," delmiter except if between for example " & "?

I'm sure there are other python modules out there that deal with
csv/delmited strings/files but I need to do this without any additional
modules.

Any advice is greatly appreciated.


Thanks!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060405/20c32de9/attachment.html>


More information about the Python-list mailing list