$ver="abc.txt"; open (IN,$ver); $new="new.txt"; open(OUT,"> $new"); while ($string=) { if ($string=~ /^FIELD/) { next; $line=; next if $line=; } else { @lines=split(/\s+/,$string); print OUT "@lines\n"; } }