Reading a file and outputting to new file

What I am wanting to do is take the data from the third and fourth columns of this document:
1
2
3
4
1 Crosby 42 82.13
2 Stills 23 100.11
3 Nash   40 14.21
4 Young  33 52.80


multiply each row's third and fourth column together, and write a new document that looks like this:
1
2
3
4
1 Crosby 3449.46
2 Stills 2302.53
3 Nash   568.4
4 Young  1742.4


but I have no idea how to do this. Does anyone have a code they could reply with to show me how this is done?
1
2
3
4
5
6
7
import fileinput

for line in fileinput.input():
    line = line.split() #separates into words
    third = float(line[2])
    fourth = float(line[3])
    print(line[0]+' '+line[1]+' '+str(third*fourth))
how does that specify the path to a specific file?
stupid me that uses stdin/stdout

1
2
3
4
5
6
7
the_input = open('input.txt', 'r')
the_output = open('output.txt', 'w')
for line in the_input:
    line = line.split()
    third = float(line[2])
    fourth = float(line[3])
    the_output.write(line[0]+' '+line[1]+' '+str(third*fourth)+'\n')
Topic archived. No new replies allowed.