Upper and Lower case

Hi,

I think this is a weird problem.

I have two files...one with all UPPER case and the other one with a mix of upper and lower.

Match each record in file1 against record in file2, if they match, then change the record in file1 to that of record in file2.

Thanks in advance.

Hi, try:

awk 'NR==FNR{A[toupper($1)]=$1;next} $1 in A{$1=A[$1]}1' file2 file1
1 Like

Try...

awk 'NR==FNR{a[toupper($1)]=$1;next}{print (a[$1]?a[$1]:$1)}' file2 file1
1 Like