in reply to how to substitute next line with nothing

Hi,

Try this

use strict; use warnings; open FH,"Input_File" or die "can't open file $!\n"; open OFH,">Output_File" or die "can't open file $!\n"; while (<FH>) { print OFH $1,$2,$3,"\n" if (/Id=(\d+,).*?Full=(.*?,).*?Type = +(.*)$/) ; }

The Output_File contains your required output.

Replies are listed 'Best First'.
Re^2: how to substitute next line with nothing
by CountZero (Bishop) on Feb 23, 2009 at 06:55 UTC
    Your script does not filter out duplicate records!

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James