[Omaha.pm] Gotta love perl...

Sean Baker pbaker at omnihotels.com
Thu Feb 12 06:07:56 PST 2009


This seemed to work for me:

 

$ perl -pi -e "s/\\?\cM\cJ//g" sean

$ perl -pi -e "s/\c@/\n/g" sean

 

To recap, the goal was to get all of this pipe delimited goo on one line
so I can manipulate easier.

 

It has \^M control characters at the end, and a CTRL-@ (or \c@, aka
NULL) at the very end that signifies a new line:

 

00:04:46,360 DEBUG [3148][] [REQUEST] ^M

@HDR|ARS1P|HRSOM|IATC55F15|GMT090604|MSN1111118FC77E14D|UTTA|SCTCTJ|SGA1
P|SOBPL||\^M

BOOKRQ|ACTSS|BKS1111111|CCN0000000|CHNOM|CTYAUS|GUTDX|GCTIK|GCN112991291
2912H\^M

ti7sfMeLXU+Xnm1wd|GUEm7hUXOLrxek=|GNMPRICELINE|IND20FEB09|OTD22FEB09|NAD
2|NAMTEST\^M

/TEST|NNT2|NPR2|NRM1|PID222222|RMR9999.99|RTYA1KCT3|SINIKXXX0108354597$P
HR686706\^M

21102$NSM RM PRFD||^@^M

 

 

Sean Baker

Software Architect

Omni Hotels

(402) 952-6508

________________________________

From: omaha-pm-bounces+pbaker=omnihotels.com at pm.org
[mailto:omaha-pm-bounces+pbaker=omnihotels.com at pm.org] On Behalf Of Jay
Hannah
Sent: Thursday, February 12, 2009 7:48 AM
To: omaha-pm at pm.org
Subject: Re: [Omaha.pm] Gotta love perl...

 


What? My 4 seconds of QA were insufficient?   :)

Try something like this?

$ perl -pi -e 's/\|\|[^ -~](\d\d:\d\d)/\|\|\n$1/g' j

j





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/omaha-pm/attachments/20090212/cc541a51/attachment.html>


More information about the Omaha-pm mailing list