Dear sathyaonunix,
Consider that the pattern that you have changed are different ie., say
XXX1
XXX2
XXX3
and these might be the contents of a file say file2.txt
now can you please help me to replace the pattern Sathya in file1 with the three patterns of file2.txt.
And what if the contents of file1 that contains
nl file 1 Sathya 2 Sathya 3 Sathya 4 Sathya 5 SAthya 6 Narayanan 7 Narayanan 8 Sathya 9 Sathya 10 Narayanan might not have a key and might be arranged in a singel line like this,
sathya sathya sathya sathya sathya Narayanan Narayanan Sathya sathya Narayanan
Please suggest me how to replace if we encounter such a problem,
Yes the solution that you have mentioned for my specified problem is correct.
But if the position of sathya varies each time then how can we solve it???
Let me explain u the problem,\
kashyap kashyap manju suhas Narayanan Narayanan frank wall sathya
So these are the contents of the file1, Now consider that initially sathya is in the last position,
But when u use the file the second time the postion might change and the new position of sathya
would be the second or third or fourth, So what i mean to say is irrespective of positions of the word sathya , i want to add the contents of file2 one after the other next to sathya.......
The number of "sathya" in file1 will be equal to the strings present in file2.
I hope u have understood my problem.
I am trying to do this for the past 15 days and i am unable achieve it,
It would be very helpful if u solve this problem.