input CK, n3065gat, n3066gat, n3067gat, n3068gat, n3069gat, n3070gat,n3100gat, test_si, test_se; output n3104gat, n3105gat, n3106gat, n3107gat, n3108gat, n3109gat, n3110gat; #### open(DATA, "s5378_scan.v") or die "error: $!"; while () { if ($_ =~ /input/) { $length_line = length ($_); $x= $length_line - 7; $portion = substr($_, 7, $x); } my $str = $portion; my $find = ","; my $replace = ";"; $find = quotemeta $find; $str =~ s/$find/$replace/g; open (MYFILE, '>data.txt'); print MYFILE "$str\n"; close (MYFILE); } # End while close(DATA)