I think I could better support you if I understood your intentions.
your code provides for an temporary output file, and assuming you meant writeLines (as there is no base function writelines and the code as provided would error).
Your code writes 3 lines to the file, the last of which is the word 'blank'
When you say you are trying to delete the last row, do you mean that you wish to delete it from the file ?
You could of course, not write it to begin with.
otherwise, you would read the file back in, adjust it, and write it out again, would be the general approach.
Generally speaking, in the R world, column names relate to data.frames (tables in memory). if you had such a dataframe, you might choose to write it out as a csv which would be a universally understood spreadsheet compatible format that would generally consider the first row to be a header row listing column names.