単語間のマップを含むファイルがあります。そのファイルを参照して、それらの単語をいくつかのファイルのマップされた単語に置き換える必要があります。たとえば、以下のファイルには、次のようにマッピングされた単語のテーブルがあります。
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
それらのキーワード(1.12.2。*)を含む多くのファイルがあります。これらのキーワードを検索し、これらの単語をこのファイルから取得した対応するマッピングに置き換えたいと思います。シェルでこれを行う方法。ファイルに次の行が含まれているとします。
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.
スクリプトを実行した後、番号「1.12.2.12」と「1.12.2.4」を5と4に置き換える必要があります(マスターファイルから参照)。誰かが私を助けることができますか?