Groups | Search | Server Info | Login | Register
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!weretis.net!feeder4.news.weretis.net!news.cgarbs.de!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!feeder3.eweka.nl!81.171.88.15.MISMATCH!eweka.nl!lightspeed.eweka.nl!postnews.google.com!l18g2000yql.googlegroups.com!not-for-mail |
|---|---|
| From | gio001 <gcrippa@gmail.com> |
| Newsgroups | comp.lang.awk |
| Subject | Regular expression in awk |
| Date | Wed, 6 Apr 2011 07:40:08 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 18 |
| Message-ID | <4e09d4fd-8351-45f0-8f17-b6ac0d32e19a@l18g2000yql.googlegroups.com> (permalink) |
| NNTP-Posting-Host | 192.138.178.108 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1302100810 21381 127.0.0.1 (6 Apr 2011 14:40:10 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Wed, 6 Apr 2011 14:40:10 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | l18g2000yql.googlegroups.com; posting-host=192.138.178.108; posting-account=qwb46QoAAAAi1NbuU6zi3MRcl0xn30MP |
| User-Agent | G2/1.0 |
| X-HTTP-UserAgent | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1),gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.awk:124 |
Show key headers only | View raw
Hello,
I have thousand of messages (HL7), I want to use awk to extract only
the ones that have a particular value in pv1.18
Each record in the file is the whole HL7 message, ie. when I print $0
I get the whole message MSH EVN PID etc. ,there is an x0d between the
segments.
I would like to use a line somewhat like:
awk '{if(/PV1\|\([^|]*\|\)\{16\}\|X/){print $0}}' infile > outfile
I do not seem to be able to get this working properly in awk on a AIX
box.
Yet this statement works fine against the infile:
grep 'PV1\|\([^|]*\|\)\{16\}\|X' infile
Can anyone please help?
Thanks.
Back to comp.lang.awk | Previous | Next — Next in thread | Find similar
Regular expression in awk gio001 <gcrippa@gmail.com> - 2011-04-06 07:40 -0700
Re: Regular expression in awk pk <pk@pk.invalid> - 2011-04-06 16:01 +0100
Re: Regular expression in awk Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-04-06 19:24 +0200
Re: Regular expression in awk Manuel Collado <m.collado@domain.invalid> - 2011-04-06 21:07 +0200
Re: Regular expression in awk gio001 <gcrippa@gmail.com> - 2011-04-06 12:25 -0700
Re: Regular expression in awk Janis Papanagnou <janis_papanagnou@hotmail.com> - 2011-04-06 23:09 +0200
Re: Regular expression in awk gio001 <gcrippa@gmail.com> - 2011-04-06 19:59 -0700
Re: Regular expression in awk Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-04-07 07:32 +0000
Re: Regular expression in awk gio001 <gcrippa@gmail.com> - 2011-04-07 05:06 -0700
Re: Regular expression in awk Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-04-07 13:34 +0000
Re: Regular expression in awk gio001 <gcrippa@gmail.com> - 2011-04-07 08:27 -0700
Re: Regular expression in awk Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2011-04-07 18:32 +0000
Re: Regular expression in awk Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2011-04-07 13:34 +0100
Re: Regular expression in awk arnold@skeeve.com (Aharon Robbins) - 2011-04-07 13:31 +0000
Re: Regular expression in awk Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2011-04-08 13:18 +0100
csiph-web