One of my process will create a file Market.txt with data like below.
Count Markt file
334936 /pdm/data001/P3_Quest_5HT_AMERGE.csv
2770787 /pdm/data001/P3_Quest_ARB_ATACAND.csv
1198143 /pdm/data001/P3_Quest_Bisp_ACTONEL.csv
3821864 /pdm/data001/P3_Quest_CONTRA_ALL_OTHER_CONTRA.csv
5014463 /pdm/data001/P3_Quest_Diab_ACTOSPLUS.csv
I will have another file Product.txt with data like below.
Marketname Products
5HT 13
ARB 11
Bisp 4
Contr 41
Diab 31
Now from first file market.txt i want to get the count of respective market and want to multiply with products which is Product.txt .Like that i want to get value from first file and want multiply with product for all markets and finally i want to summarize value for all the markets.
example
334936*13+2770787* 11+1198143* 4+3821864*41+5014463* 31=409560379929
Using shell script how to achive above one.
Note:In both files market names will be in same order.