Stop saying "consts", you never use it correctly. "const" means constant. You can't assign anything to a constant after it has been declared.
Also, where is your file read code? Reading two files is just as easy as reading one file. You either need two different file handles or you need to open one after the other. The latter is likely more appropriate here.