Appending a column in one file to the corresponding line in a second

It appears that this has been asked and answered in similar fashions previously, but I am still unsure how to approach this.

I have two files containing user information:

fileA
ttim:/home/ttim:Tiny Tim:632
ppinto:/home/ppinto:Pam Pinto:633

fileB
ttim:xkfgjkd*&#^jhdfh
ppinto:ckkdfuethm@1jdhf#4$jdfh'

I wish to insert the second column from fileB to the end of each corresponding user of fileA. First a : colon needs to be inserted followed by the column entry.

Thanks for any guidance. I have looked at both sed and awk but they both seem to be beyond me. :confused:

Regards

Try...

awk -F: 'FNR==NR{a[$1]=$2;next}{print $0 FS a[$1]}' fileB fileA > fileC
join -t: fileA fileB

Read the man page for join if the output is not what you want.

The join was the easiest approach and worked wonderfully. Thanks for the help.