Creating a new text file that has specific information from two other text files
===

I am trying to create a new text file that will contain specific info from two other text files. The problem is, the other two text files are both relatively large. I am having a problem extracting certain info from the one text file to correspond to the other text file.The biggest challenge I am having is that I don't know how to have python extract the corresponding object in the same position as the other file.
If anyone can help or give a suggestion, that would be great. I am stuck on getting started. Thanks so much.
Below is an example of the idea of what I need to do.

File 1

NAME 3
ATOM 1 4 0 0 0

File 2:
3  3  
 (INPUT) - Node Node 1 