Hello All,
I need help I have a problem in searching the pattern in a file
let us say the file contains the below lines
line 1 USING *'/FILE/FOLDER/RETURN')
.................
.................
line 4 USING *'/FILE/FOLDER/6kdat1')
line 5 USING *'/FILE/FOLDER/4kdat1')
.................
.................
line 8 USING *'/FILE/FOLDER/TMPSPACE')
.................
line 9 USING *FILE '/FILE/FOLDER/TEST'100004)
.................
line 11 USING *FILE '/FILE/FOLDER/TEST'2000)
.................
.................
line 14 USING *FILE '/FILE/FOLDER/TEST'2000)
.................
line 16 USING *FILE '/FILE/FOLDER/TEST'3000)
Actually i want to search a pattern in the file, lets say USING *, if the pattern is found then get each line
for example the pattern is found in the following lines line 1,4,5,8,9,11,14,16
Then get each line and go to the end of the line and
check whether the line ends with a number say here in line 9,11,14,16 it ends with a number but with ) as the last character.
and replace the number with another input string.
Actually i tried lot of options in PERL but could not get a proper solution for this.
Can anyone please help in this regard.
Thanks
Rahul