9

Print specific lines after a text present in another text file

view full story
linux-howto

http://stackoverflow.com – I have two text files. Text-file-1 contains numbers (one number per line); 010 020 024 Text-file-2 contains data in following format; C 005 Carbon D Carbon 1 D Carbon 2 D Carbon 3 D Carbon 4 C 010 Hydrogen D Hydrogen 1 D Hydrogen 2 C 017 Oxygen D Oxygen 1 C 020 Nitrogen D Nitrogen 1 D Nitrogen 2 D Nitrogen 3 C 024 Sulphur D Sulphur 1 D Sulphur 2 Desired output; C 010 Hydrogen D Hydrogen 1 D Hydrogen 2 C 020 Nitrogen D Nitrogen 1 D Nitrogen 2 D Nitrogen 3 C 024 Sulphur D Sulphur 1 D Sulphur 2 Al (HowTos)