Help reading an input file in KSH

First I' d like to say you guys are awesome. :slight_smile:

I have a word document that I cut and paste into Textpad and it removed all the fancy formatting which is fine with me. I WinScp'd it to the box and and called it inputfile.txt.

Opened it in vi and don't see any special characters or stuff that my cause me headaches. Good.

The text looks like this.

  1. (name of sql statement)
    (blank line)
    (actual sql statement)

  2. (name of sql statement)
    (blank line)
    (actual sql statement)

.... for around 15 sql statements

so the last line is

  1. (name of sql statement)
    (blank line)
    (actual sql statement)

I looped thru the file with the while ....read $line do echo $line done
and I can see every line.

I would like to be able to populate a variable with the (actual sql statement)
then I can connect to a database and execute that statement. Can someone help me with this?

Thank you

while read;read;read;do
  echo "$REPLY"
done<file|sqlplus user/pass

Thanks for this help.
I was able to use this to do exactly what I needed.

Thanks Again