Hi,

This took a few tries to knock out:
my $In = " Dec 20 13:28 guard/AFRC_AFRC00_01";
#s/ *(\w*) (.*)/ $1| $2|/;
$In =~
s/ *(\w+) +(\d+) +(\d+:\d+) +(.*)\/(\D*_\D*)(\d+)_(\d+)/ $1| $2| $3 |$4\/|$5|$6_|$7/;
print "$In\n";


Desired:
 Dec| 20| 13:28 |guard/|AFRC_AFRC|00_|01
Results:
 Dec| 20| 13:28 |guard/|AFRC_AFRC|00_|01

Joseph

Jensen Kenneth B SrA AFPC/DPDMPQ wrote:

> Trying to make a one liner regxp to covert a file. File has lines like these
> (lines are preceded with a space)
>
>  Dec 20 13:28 guard/AFRC_AFRC00_01
>  Nov 22 2001 guard/ANCHORAGE_668300_14
>  Dec 20 08:46 guard/ALPENA_MI_503000_79
>  Dec 30 06:51 guard/ANDREWS_MD_525700_93
>
> Output needs to look like this with pipelines inserted.
>  Dec| 20| 13:28 |guard/|AFRC_AFRC|00_|01
>  Nov| 22| 2001 |guard/|ANCHORAGE_6683|00_|14
>  Dec| 20| 08:46 |guard/|ALPENA_MI_5030|00_|79
>  Dec| 30| 06:51 |guard/|ANDREWS_MD_5257|00_|93
>
> The regex's I've tried have been pretty far off. Any help in this greatly
> appreciated.
>
> Ken


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to