Hi,
I have one more question ..
I have a line which looks like this ..
(`CHN_WSM.CG_AB C_CLK)
In the same file, there is a another line which looks like this
(`CHN_ABC.SOB_A BC_DATA_E),
I need to put a search and replace syntax in perl, so that the string "ABC" after the "." is replaced by XYZ ..
Which means , the output file will have the following two strings
(`CHN_WSM.CG_XY Z_CLK),
(`CHN_ABC.SOB_X YZ_DATA_E),
I used this syntax -- for that ..
$inp_line[1] =~ s/\.(.*ABC)/\.XYZ/;
But this gave me an output of --
(`CHN_WSM.XYZ_C LK),
(`CHN_ABC.XYZ_D ATA_E),
How do I maintain the original line and just insert the replacement .. ?
Anand
I have one more question ..
I have a line which looks like this ..
(`CHN_WSM.CG_AB C_CLK)
In the same file, there is a another line which looks like this
(`CHN_ABC.SOB_A BC_DATA_E),
I need to put a search and replace syntax in perl, so that the string "ABC" after the "." is replaced by XYZ ..
Which means , the output file will have the following two strings
(`CHN_WSM.CG_XY Z_CLK),
(`CHN_ABC.SOB_X YZ_DATA_E),
I used this syntax -- for that ..
$inp_line[1] =~ s/\.(.*ABC)/\.XYZ/;
But this gave me an output of --
(`CHN_WSM.XYZ_C LK),
(`CHN_ABC.XYZ_D ATA_E),
How do I maintain the original line and just insert the replacement .. ?
Anand
Comment