Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #27979
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <gandalf@shopzeus.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.027 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; 'python.': 0.02; 'mentioned,': 0.07; 'suggest': 0.11; 'files.': 0.13; ':-)': 0.13; 'value.': 0.15; 'blocks': 0.16; 'subject:File': 0.16; 'subject:Text': 0.16; 'wrote:': 0.17; 'changes': 0.20; 'file.': 0.20; 'to:2**1': 0.23; 'header': 0.24; 'tried': 0.25; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'in.': 0.27; 'module.': 0.27; 'mining': 0.29; "i'm": 0.29; 'code': 0.31; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'text': 0.34; 'especially': 0.35; 'there': 0.35; 'really': 0.36; 'but': 0.36; 'too': 0.36; 'best,': 0.37; 'well.': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'first': 0.61; 'traffic': 0.61; 'worth': 0.63; 'received:204': 0.72; 'distinguish': 0.84; 'hard.': 0.84; 'results,': 0.91; 'subject:From': 0.97 |
| Date | Mon, 27 Aug 2012 13:55:52 +0200 |
| From | Laszlo Nagy <gandalf@shopzeus.com> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 |
| MIME-Version | 1.0 |
| To | Huso <hussain.a.rasheed@gmail.com>, python-list@python.org |
| Subject | Re: Extract Text Table From File |
| References | <481dc39d-1dee-4ebe-97d5-ccad659f8c74@googlegroups.com> <mailman.3865.1346062345.4697.python-list@python.org> <8e48635a-f873-40ce-b886-2ffc058f9eb4@googlegroups.com> |
| In-Reply-To | <8e48635a-f873-40ce-b886-2ffc058f9eb4@googlegroups.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3871.1346068558.4697.python-list@python.org> (permalink) |
| Lines | 20 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1346068558 news.xs4all.nl 6926 [2001:888:2000:d::a6]:37387 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:27979 |
Show key headers only | View raw
On 2012-08-27 13:23, Huso wrote:
> Hi,
>
> There can be any number of blocks in the log file.
> I distinguish the block by the start header 'ROUTES TRAFFIC RESULTS, LSR' and ending in 'END'. Each block will have a unique [date + time] value.
>
> I tried the code you mentioned, it works for the data part.
> But I need to get the TRG, MP, DATE and TIME for the block with those data as well. This is the part that i'm really tangled in.
>
> Thanking,
> Huso
Well, I suggest that you try to understand my code and make changes in
it. It is not too hard. First you start reading documentation of the
"re" module. It is worth learning Python. Especially for mining data out
of text files. :-)
Best,
Laszlo
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Extract Text Table From File Huso <hussain.a.rasheed@gmail.com> - 2012-08-27 02:53 -0700
Re: Extract Text Table From File Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-27 12:12 +0200
Re: Extract Text Table From File Huso <hussain.a.rasheed@gmail.com> - 2012-08-27 03:34 -0700
Re: Extract Text Table From File Huso <hussain.a.rasheed@gmail.com> - 2012-08-27 03:34 -0700
Re: Extract Text Table From File Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-27 13:07 +0200
Re: Extract Text Table From File Huso <hussain.a.rasheed@gmail.com> - 2012-08-27 04:23 -0700
Re: Extract Text Table From File Huso <hussain.a.rasheed@gmail.com> - 2012-08-27 04:23 -0700
Re: Extract Text Table From File Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-27 13:55 +0200
Re: Extract Text Table From File Ramchandra Apte <maniandram01@gmail.com> - 2012-09-05 06:08 -0700
Re: Extract Text Table From File Tim Chase <python.list@tim.thechases.com> - 2012-09-05 11:25 -0500
Re: Extract Text Table From File Tim Chase <python.list@tim.thechases.com> - 2012-08-27 07:42 -0500
csiph-web