#!/usr/bin/perl use strict; use warnings; our ($fileIn, $fileOut); use Getopt::Long; GetOptions( 'FileIn=s' => \$fileIn, 'FileOut=s' => \$fileOut, ); if($fileIn && $fileOut) { open(INPUT,"<","$fileIn"); #undef $/; while() { next if /^\n/; s/\t+//g; s/^\s+//g; if(/^HEADER(.*?)^GENRE_BY(.*)/sm) { print ; } } }