deleting lines

I am spooling a file from oracle and trying to delete the last line of the spooled file which I am unable to do.

Problem is that this file can have multiple records each time and I have no way of knowing how many because the amount can vary. I had an idea of using a while loop to read the file but I need to delete the last line which happans to be blank. Any suggustions would be helpful.

thanks

You might try using wc -l to find the number of lines and then head to send the number given by wc -l (minus 1) to a new file. This may or may not work for you - it may not keep the format you have.