To open and read the file into a variable you can use, but in terms of finding the number, if you say finding a certain number, it sounds like that number is a known number, which means you'd know what to write to the other file before even parsing the html file. If the number is unknown, you'll have to find it with a pattern, unless the HTML file only has a number in it. To write data to a file you'd use