use strict; use warnings; local $/= "\n="; while (my $line = ) { print "\n------------------------------\n"; if ($line =~ m/Primary \(Reporting\) Cp\s*:\s*((?:(?!Set).)*)Set\s*:\s*((?:(?!Car).)*)Car\s*:\s*((?:(?!Ref).)*)/si) { print "Cp:$1 - Set:$2 - Car:$3"; } if ($line =~ m/Phase\s*:\s*((?:(?!Strength).)*)Strength\s*:\s*((?:(?!\n).)*)/si) { print "\nPhase:$1 - Strength:$2\n"; } while ($line =~ m/(?## ------------------------------ Cp:113 - Set:2 - Car:1 Phase:0x2fdf - Strength:24 ------------------------------ ------------------------------ Cp:115 - Set:1 - Car:2 Phase:0x7d10 - Strength:31 Keep:1 Phase: 0x7d10 Strength: 31 Secondary Sector Information: Slot 1: Keep: 1 - offset:391 - Strength:27 Keep:1 - offset:325 - Strength:38 ------------------------------ #### ------------------------------ Cp:113 - Set:2 - Car:1 Phase:0x2fdf - Strength:24 ------------------------------ ------------------------------ Cp:115 - Set:1 - Car:2 Phase:0x7d10 - Strength:31 Keep:1 Phase: 0x7d10 Strength: 31 Keep:1 - Pn_offset:391 - Strength:27 Keep:1 - Pn_offset:325 - Strength:38 ------------------------------