Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.060 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'subject:Python': 0.04; '(same': 0.07; 'awk': 0.16; 'example).': 0.16; 'peter,': 0.16; 'previously,': 0.16; 'subject:Convert': 0.16; 'subject:regex': 0.16; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'header:In- Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'file,': 0.22; 'filter': 0.22; 'individually': 0.23; 'received:209.85.213': 0.23; 'example': 0.24; 'skip:[ 10': 0.26; 'id:': 0.27; 'string': 0.29; 'from:addr:googlemail.com': 0.29; 'cc:addr:python.org': 0.31; 'selecting': 0.31; 'separated': 0.31; 'break': 0.33; 'several': 0.33; '(for': 0.33; 'lines': 0.34; 'file.': 0.34; 'file': 0.35; 'couple': 0.35; 'header:User-Agent:1': 0.35; 'processing': 0.37; 'received:209.85': 0.37; 'received:google.com': 0.38; 'current': 0.38; 'log': 0.38; 'lets': 0.39; 'received:209': 0.39; 'except': 0.39; 'similar': 0.40; 'essence': 0.68; 'to:addr:googlegroups.com': 0.69; 'thousands': 0.69; 'evaluate': 0.72; 'reply-to:no real name:2**0': 0.72; 'header:Reply-To:1': 0.72; 'spaces': 0.73; 'fields).': 0.84; 'skip:c 90': 0.84; 'reply- to:addr:googlegroups.com': 0.93 Newsgroups: comp.lang.python Date: Mon, 16 May 2011 03:57:49 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=195.233.250.6; posting-account=cLrwyAoAAAB9UeiSeYmBPmVn0SNqa__5 User-Agent: G2/1.0 MIME-Version: 1.0 Subject: Re: Convert AWK regex to Python From: J To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: comp.lang.python@googlegroups.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 24 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305543472 news.xs4all.nl 32470 [::ffff:82.94.164.166]:60157 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5511 Hello Peter, Angelico, Ok lets see, My aim is to filter out several fields from a log file and wri= te them to a new log file. The current log file, as I mentioned previously= , has thousands of lines like this:- 2011-05-16 09:46:22,361 [Thread-4847133] PDU D All the lines in the log file are similar and they all have the same length= (same amount of fields). Most of the fields are separated by spaces excep= t for couple of them which I am processing with AWK (removing "