formfeed problem

i am running an .sql script in sqlplus which is spooling in a file. but when i am opening the file using vi editor it is showing ^L in front of 1st,2nd and last line.
when i am opening the file with cat this problem is not there.
how to solve this problem?
this above mentioned file is the input to another programe so the ^L is absolutely not desirable.
please try to give a solution!

It's been a while since I have worked with SQL. I can tell your there is a solution to this problem in SQL and Unix. You may want to post on an Oracle forum. The SQL solution I remember is to basically set the page length longer then the output (like 100000). Unfortunately I cannot remember how to do that.

The Unix solution can be done several ways with a global replace. With vi just type this sequence

:%s/ctrl+v+L//g

The output on the screen should look like this:

:%s/^L//g

The ctrl+v+L may take a few tries to get it right, it's all about timing.

This will replace the ^L with nothing. This may offset your format so you may have to do this instead:

:%s/^L/ /g

The other easy option is with sed:

sed 's/^L//g' inputfile.txt > outputfile.txt

The ctrl+v+L is needed again to create the ^L. The output file will not contain the ^L.