1.

Solve : Replace a string in korn shell script?

Answer»

I have a requirement where in the following data is present in the file:

input.txt

1|1|1|2|11123|2|1|4|5|6
3333|456|1|345|1111|1|1|6|45|
1234|4|11|1|1|345|1|4|5
and so on........

I WANT to replace "1" which will always COME at 7th index with "2" and REDIRECT the output to a new file. The output file must look like this:

output.txt
1|1|1|2|11123|2|2|4|5|6
3333|456|1|345|1111|1|2|6|45|
1234|4|11|1|1|345|2|4|5

Also PLEASE suggest some SOLUTION in korn shell as bash is not supported in my system



Discussion

No Comment Found