I need to merge two files that I have but I first need it to match before merging them. This is my first file containing lets say 1 Million lines.
abcde
fghi
jklmn
opqrs
123456
0000
Second file contains 3 million lines but still some lines has the string that's in the first file.
543123:fdfdss
dfskld:533fg
abcde:1234
fdskls:fkdfs
gfdkls:flfds
0000:5432
fdsk:saakl
Output:
abcde:1234
fghi
jklmn
opqrs
123456
0000:5432
I want the output to be file1:file2 but only if it matches with the first column of file2 with the string in file1. I don't want to scramble the sorting format I want it to be in this order and I want to keep the file1 strings but just add the matching strings.