The problem is that you're mixing you output (<<
) and input (>>
) operators when attempting to write to outFile
. That is, you use the input operator instead of the output.
You also have this problem
"LOCAL INFILE "data/out.txt"\n"
Don't you mean
"LOCAL INFILE data/out.txt\n"
or
"LOCAL INFILE \"data/out.txt\"\n"
or (knowing SQL strings are in single quotes)
"LOCAL INFILE 'data/out.txt'\n"
As it's quite obvious you have just done copy-paste with some replacements, you might want to consider making something that put all common code into one place, like say a function? This way, when you change the common code you only have to do it in one place and not in multiple (with the chance of forgetting one).