Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #49647
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Neil Cerutti <neilc@norwich.edu> |
| Newsgroups | comp.lang.python |
| Subject | Re: Parsing Text file |
| Date | 2 Jul 2013 19:24:26 GMT |
| Organization | Norwich University |
| Lines | 31 |
| Message-ID | <b3gnnaFbe60U1@mid.individual.net> (permalink) |
| References | <08ae2828-1532-47b6-a9cb-208549189467@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net k+5775Gp5vJKGVVxY8ZrZQGkUU2lU+SmzBG1x+0H9QUf0VDg0K |
| Cancel-Lock | sha1:zXoOqYWEp8Dr31Q5rRJdFxpbiWs= |
| User-Agent | slrn/0.9.9p1/mm/ao (Win32) |
| Xref | csiph.com comp.lang.python:49647 |
Show key headers only | View raw
On 2013-07-02, sas429s@gmail.com <sas429s@gmail.com> wrote: > I have a text file like this: > > Sometext > Somemore > Somemore > maskit > > Sometext > Somemore > Somemore > Somemore > maskit > > Sometext > Somemore > maskit > > I want to search for the string maskit in this file and also > need to print Sometext above it..SOmetext location can vary as > you can see above. > > In the first instance it is 3 lines above mask it, in the > second instance it is 4 lines above it and so on.. > > Please help how to do it? How can you tell the difference between Sometext and Somemore? -- Neil Cerutti
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Parsing Text file sas429s@gmail.com - 2013-07-02 11:45 -0700
Re: Parsing Text file Neil Cerutti <neilc@norwich.edu> - 2013-07-02 19:24 +0000
Re: Parsing Text file sas429s@gmail.com - 2013-07-02 12:30 -0700
Re: Parsing Text file Tobiah <toby@tobiah.org> - 2013-07-02 12:50 -0700
Re: Parsing Text file Neil Cerutti <neilc@norwich.edu> - 2013-07-02 20:12 +0000
Re: Parsing Text file sas429s@gmail.com - 2013-07-02 13:28 -0700
Re: Parsing Text file Joshua Landau <joshua.landau.ws@gmail.com> - 2013-07-02 21:56 +0100
Re: Parsing Text file Denis McMahon <denismfmcmahon@gmail.com> - 2013-07-03 00:55 +0000
Re: Parsing Text file Joshua Landau <joshua.landau.ws@gmail.com> - 2013-07-02 21:28 +0100
csiph-web