[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Gotta love perl...



Title: Re: [Omaha.pm] Gotta love perl...

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|SGA1P|SOBPL||\^M

BOOKRQ|ACTSS|BKS1111111|CCN0000000|CHNOM|CTYAUS|GUTDX|GCTIK|GCN1129912912912H\^M

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

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

21102$NSM RM PRFD||^@^M

 

 

Sean Baker

Software Architect

Omni Hotels

(402) 952-6508


From: omaha-pm-bounces+pbaker=omnihotels.com@pm.org [mailto:omaha-pm-bounces+pbaker=omnihotels.com@pm.org] On Behalf Of Jay Hannah
Sent: Thursday, February 12, 2009 7:48 AM
To: omaha-pm@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