Re: [Tutor] splits and pops

2008-07-12 Thread Marcel Wunderlich
Hi Eric, I tried following and it seems to work: fullstring = """l1r1 ll1r2 l1r3l1 r4 l1r5 l2r1l2r3l3 r3 l2r4l2r5 l3r1l3r2l3r3l3r4l3r5 """ # This should be a string like your's. "\t"-seperated columns, "\n"-seperated # rows, with "\n" in some co

Re: [Tutor] splits and pops

2008-07-12 Thread Kent Johnson
On Sat, Jul 12, 2008 at 8:55 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > I've been fooling around with variations on the following (assuming > splitlist = fullstring.split('\t')): > > for x in xrange(8, sys.maxint, 8): >try: >splitlist[x:x] = splitlist.pop(x).split('\n') >exce

Re: [Tutor] splits and pops

2008-07-12 Thread bob gailer
Please reply to the list and not just me. That way we all get to contribute and to learn. Eric Abrahamsen wrote: Sorry I haven't explained this clearly, it's just one more symptom of my confusion... Your example has a tab between records as well as between fields: That's not how I see it! L

Re: [Tutor] splits and pops

2008-07-12 Thread bob gailer
Eric Abrahamsen wrote: I have a horribly stupid text parsing problem that is driving me crazy, and making me think my Python skills have a long, long way to go... What I've got is a poorly-though-out SQL dump, in the form of a text file, where each record is separated by a newline, and each f

[Tutor] splits and pops

2008-07-12 Thread Eric Abrahamsen
I have a horribly stupid text parsing problem that is driving me crazy, and making me think my Python skills have a long, long way to go... What I've got is a poorly-though-out SQL dump, in the form of a text file, where each record is separated by a newline, and each field in each record