File 1 example:- WL,BL,Die1 WL0,BL0,1708 WL0,BL1,1708 WL0,BL2,1708 WL0,BL3,1931 WL0,BL4,1931 File 2 example:- WL,BL,Die 2 WL0,BL0,1708 WL0,BL1,1931 WL0,BL2,1708 WL0,BL3,1931 WL0,BL3,1708 Output after script:- WL,BL,Die1, Die2 WL0,BL0,1708,1708 WL0,BL1,1708,1931 WL0,BL2,1708,1708 WL0,BL3,1931,1931 WL0,BL4,1931,1708 My script:- #!/usr/bin/perl #Copy Die2 as Output file use File::Copy; copy ("Die2_10k.txt","CombineDie1Die2.txt") or die "copy failed: $!"; #Open Die1 Input file open (Label, "Die1_10k.txt") or die "can't open Die1: $!"; #Search and replace using 1 liner command while (