I have a file that contains the map between the words. I have to refer to that file and replace those words with the mapped ones in some files. For example, below file has the table of words that are mapped like
1.12.2.4 1
1.12.2.7 12
1.12.2.2 5
1.12.2.4 4
1.12.2.6 67
1.12.2.12 5
I will have many files that has those key words (1.12.2.*). I want to search for these key words and replace those words with the corresponding mapping taken from this file. How to do this in shell. Suppose a file contains the following lines say
The Id of the customer is 1.12.2.12. He is from Grg.
The Name of the machine is ASB
The id is 1.12.2.4. He is from Psg.
After executing the script, the Numbers "1.12.2.12" and "1.12.2.4" should be replaced by 5 and 4 (referred from the master file). Can anyone help me out?
See Question&Answers more detail:os