Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70590 > unrolled thread

Re: how to split this kind of text into sections

Started byChris Angelico <rosuav@gmail.com>
First post2014-04-25 23:31 +1000
Last post2014-04-25 23:31 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: how to split this kind of text into sections Chris Angelico <rosuav@gmail.com> - 2014-04-25 23:31 +1000

#70590 — Re: how to split this kind of text into sections

FromChris Angelico <rosuav@gmail.com>
Date2014-04-25 23:31 +1000
SubjectRe: how to split this kind of text into sections
Message-ID<mailman.9493.1398432720.18130.python-list@python.org>
On Fri, Apr 25, 2014 at 11:07 PM, oyster <lepto.python@gmail.com> wrote:
> the above text should be splitted as a LIST with 3 items, and I also need to
> know the KEY for LIST is ['I am section', 'let's continue', 'I am using']:

It's not perfectly clear, but I think I have some idea of what you're
trying to do. Let me restate what I think you want, and you can tell
be if it's correct.

You have a file which consists of a number of lines. Some of those
lines begin with the string "I am section", others begin "let's
continue", and others begin "I am using". You want to collect those
three sets of lines; inside each collection, every line will have that
same prefix.

Is that correct? If so, we can certainly help you with that. If not,
please clarify. :)

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web