Input file
1 testing 10 20 1
A testing 20 40 1
3 testing 23 232 2
1 testing 10 243 2
.
.
Reference file
1 final
3 used
.
.
Output file
final testing 10 20
A testing 20 40
used testing 23 232
final testing 10 243
.
.
I would like to replace those content that shown in column 1 of input file with the content that shown in reference file (if available).
Thanks.