Help with replace column one content based on reference file

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.

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Continue here:

http://www.unix.com/shell-programming-scripting/160442-help-replace-column-one-content-based-reference-file.html\#post302525608

Thank You.

The UNIX and Linux Forums.