Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #70590 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2014-04-25 23:31 +1000 |
| Last post | 2014-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.
Re: how to split this kind of text into sections Chris Angelico <rosuav@gmail.com> - 2014-04-25 23:31 +1000
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-04-25 23:31 +1000 |
| Subject | Re: 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
Back to top | Article view | comp.lang.python
csiph-web