in reply to Extracting formatted text block

#! perl -slw use strict; my @names; my $fmt; my( @col1, @col2 ); while( <DATA> ) { if( m[INTERESTING CODE--] .. m[^\s*$] ) { if( m[^\s*$] ) { print join', ', grep defined, @col1, @col2; @names = @col1 = @col2 = (); undef $fmt; next; } if( m[^[\s-]+$] ) { $fmt .= "\@$-[-1] A${ \( $+[-1]-$-[-1]) }" while m[\s+([-] ++)]g; next; } next unless $fmt; $_ .= chr(0)x100; ( undef, $col1[@col1], undef, $col2[@col2] ) = unpack $fmt, $_ +; } }

Input and output

[ 3:18:33.32] P:\test>440187 NAME ONE, NAME TWO THREE, NAME FOUR ..., NAME FIVE - SIX, NAME SEVEN, +NAME EIGHT ..., NAME NINE - TEN, NAME ELEVEN, NAME TWELVE, NAME 01, NAME 02, NAME 03, NAME 04, NAME 05, NAME 06, NAME 07, NAME 08 +, NAME 09, NAME 10, NAME 011, NAME 012, NAME 013, NAME 014, NAME 015, + NAME 016, NAME 017, NAME 018, NAME 019, __DATA__ blah blah blah blah blah blah blah blah blah blah blah blah INTERESTING CODE-- CODE NAME CODE NAME -------- ----------------------- -------- ----------------------- ABC NAME ONE RST NAME EIGHT ... DEF NAME TWO THREE WXY NAME NINE - TEN GHIJK NAME FOUR ... ZAB NAME ELEVEN LMN NAME FIVE - SIX CDE NAME TWELVE OPQ NAME SEVEN more blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah INTERESTING CODE-- CODE NAME CODE NAME -------------- ----------------- ------ ----------------------- ABC NAME 01 RST NAME 011 DEF NAME 02 WXY NAME 012 GHIJK NAME 03 ZAB NAME 013 LMN NAME 04 CDE NAME 014 OPQ NAME 05 zzz NAME 015 ABC NAME 06 RST NAME 016 DEF NAME 07 WXY NAME 017 GHIJK NAME 08 ZAB NAME 018 LMN NAME 09 CDE NAME 019 OPQ NAME 10 more blah blah blah

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?