Sorry for not having a clear title. I’ll try to explain my question.
I have two files A and B.
The format of file A is something like this:
set_time 10 temp max 2 min 1 xyzzy
set_time 10 temp max 2 min 1 abcde
set_time 10 temp max 3 min 2 ersfg
set_time 8 temp max 2 min 0 fdfdf
File B looks like this:
xyzzy 7.5
abcde 8.5
ersfg 9.5
fdfdf 9.0
Now, what needs to be done is, I have to search for the last column names in file A (xyzzy, abcde, fdfdf, etc.) and replace the 2nd column values with those 2nd column values from file B.
So, the output should look like:
set_time 7.5 temp max 2 min 1 xyzzy
set_time 8.5 temp max 2 min 1 abcde
set_time 9.5 temp max 3 min 2 ersfg
set_time 9.0 temp max 2 min 0 fdfdf
Any help is appreciated. This is a part of a TCL flow.
Read the second file with the mappings, something like this:
Then process the original file by making
set_timea command that outputs itself, while changing the desired value:and then just
sourcethe original data file:This assumes of course that the two files have no other lines in them that would mess up the processing.