I have a list of files of similar format. I want to extract all lines form each file that are containing exact character for example I need to extract only lines with TPO and saving to another file also I need to extract only lines with HOH and saving to another file. Regarding each file may contain different character that I need to extract separately (not collectively)
Example
HETATM 1271 N TPO A 160 65.018 41.561 0.708 1.00 18.62 N
HETATM 1272 CA TPO A 160 63.724 42.043 1.187 1.00 20.80 C
HETATM 1273 C ACE A 160 65.018 41.561 0.708 1.00 18.62 C
HETATM 1274 O ACE A 160 65.018 41.561 0.708 1.00 18.62 O
HETATM 1275 CH3 ACE A 160 65.018 41.561 0.708 1.00 18.62 C
HETATM 1276 O HOH A 160 65.018 41.561 0.708 1.00 18.62 O
HETATM 1277 H HOH A 160 63.724 42.043 1.187 1.00 20.80 H