splitting delimited strings

Mark Harrison mh at pixar.com
Wed Jun 15 19:03:55 EDT 2005


What is the best way to process a text file of delimited strings?
I've got a file where strings are quoted with at-signs, @like this at .
At-signs in the string are represented as doubled @@.

What's the most efficient way to process this?  Failing all
else I will split the string into characters and use a FSM,
but it seems that's not very pythonesqe.

@rv@ 2 @db.locks@ @//depot/hello.txt@ @mh@ @mh@ 1 1 44
@pv@ 0 @db.changex@ 44 44 @mh@ @mh@ 1118875308 0 @ :@@: :@@@@: @

(this is from a perforce journal file, btw)

Many TIA!
Mark

-- 
Mark Harrison
Pixar Animation Studios



More information about the Python-list mailing list