Looking for shell script to modify file2 below based on first file. Basically I need to look for rows start with "TAPES" in file1, then I have to take 2nd column in that line "LOC" and look for matching word in file2, then edit that line in file2, the third column in file1 in that row tells that column should edit in file2, basically third column tells which column should edit in file, the fourth column in file1 is the replacement in file2 in that column. I should pass "TAPES" to the script and second file name like below. can I get script?.
./script1 file2 TAPES
file1
TAPES|LOC|2|CA
CD|TOP|5|CA
TAPES|LOC|3|PA
CD|TOP|5|CA
TAPES|LOC|5|TX
file2
LOC|2|STATE|NOT|FILL|
LOC|2|PXA|FILL|EMPTY|
LOC|2|STATE|NOT|FILL|