Reading and copying few lines based on some condition

Hi, I have two text files. Textfile1 has data line by line (50000 lines) and in each line, there are 500 numeric values. Textfile2 has only one column (only numeric data) which matches the first column of Textfile1. Textfile2 may have 5000 lines (Each line has one numeric value).
Now my task is to read Textfile2 line by line, read its numeric value and match with the first numeric value of Textfile1, If it matches, then it should copy the whole line and paste it to Textfile3. Please help me to do this. I am new to C#, so just tried in the following program.