tcl
I wanna compare two files line by line.
file1
- abc
- 123
- a1b2c3
file2
abc
00 a1b2c3
if the line of file1 matched one of the line of file2, change the line of file1 to the line of file2
so the output file woule be like that.
file1
abc
- 123
00 a1b1c3
please help me thank you
Here's a working example, if necessary adjust file paths to fit your needs.
This code makes a temporary work file that overwrites the original file1 at end.