Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: header footer

by Kenosis (Priest)
on Mar 04, 2014 at 23:08 UTC ( #1077003=note: print w/replies, xml ) Need Help??


in reply to Re^3: header footer
in thread header footer

Give your dataset, here's one option:

use strict; use warnings; local $/ = 'HDR'; while (<DATA>) { chomp; s/\n+$//; print substr( $_, 47, ( length $_ ) - 77 ), "\n" if /\S/; } __DATA__ HDR.S287878877.DDDDD.DDDDDDXXXXXXXXXXXXXXXXXXXXXXX1STR HYTRES NAME PLA +CE DEST GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGG11111111111111111111122222222222222222222222222223 +33333333333333333333333333444444444444444444444444444444444455 5555555555555555555555555555566666666666666777777777777FTRDDDDDDDDDDFF +FFFFFFFFFFFFFFF HDR.S287878877.DDDDD.DDDDDDXXXXXXXXXXXXXXXXXXXXXXX1STR HYTRES NAME PLA +CE DEST GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGG11111111111111111111122222222222222222222222222223 +33333333333333333333333333444444444444444444444444444444444455 5555555555555555555555555555566666666666666777777777777FTRDDDDDDDDDDFF +FFFFFFFFFFFFFFF

Output:

1STR HYTRES NAME PLACE DEST GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGG11111111111111111111122222222222222222222222222223 +33333333333333333333333333444444444444444444444444444444444455 5555555555555555555555555555566666666666666777777777777 1STR HYTRES NAME PLACE DEST GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGG11111111111111111111122222222222222222222222222223 +33333333333333333333333333444444444444444444444444444444444455 5555555555555555555555555555566666666666666777777777777

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1077003]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2021-09-17 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?