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
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
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
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
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