File 1 - master list key1 other stuff key2 other stuff key3 other stuff ... File 2 - subset listing key1 more stuff key3 more stuff ... Desired result: File3 - final listing - subset listing with matching keys from master listing concatenated at end key1 more stuff other stuff key3 more stuff other stuff