Kent,

Your multistrip tid-bit worked perfectly. Thanks!

The reason why I didn't want the import solution is that I am learning
python because I want to parse text data. This problem was perfect practice.

Thanks for the links. I'll check them out. You don't happen to have any
parsing tutorials bookmarked somewhere do you? I'm already exploring
http://gnosis.cx/TPiP/. It's pretty heavy though.

Best,

Grant

On 6/1/07, Kent Johnson <[EMAIL PROTECTED]> wrote:

Grant Hagstrom wrote:
> Thanks for your help Alan.
>
> I found that when I used the code, it did returne a list but it is
> riddled with formatting characters.
> My question is, is it possible to strip out multiple characters at once?

Yes, just pass multiple characters to strip(), e.g.
line = line.strip('\r\n\t \'",')

I'm curious why you don't like the import solution. exec and execfile()
could also work although all three require that the file contain trusted
data.

Here are a couple of recipes that do almost what you want (you would
still have to strip out the "jobs = " part:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/364469
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/281056

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to