korn shell script

hi all

i am writing the korn shell script.
i have a SQL script which gives me the folowing output

DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400
DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400
DSA.WLG.20050711210100.20051025.20050711210100 25881 1130198400
DSA.WLG.20050711210100.20051025.20050711210100 28991 1130198400

i have to write a korn shell script which will move the

DSA.WLG.20050713211544.20051025.20050713211544 SA.WLG.20050713211544.20051025.20050713211544
DSA.WLG.20050711210100.20051025.20050711210100
DSA.WLG.20050711210100.20051025.20050711210100

the above to a folder say /home/pav and

28991 1130198400
25881 1130198400
25881 1130198400
28991 1130198400

the above to a different folder say /home/ssk

can anyone help me please

thanks

when you say 'move' I assume the output of the SQL script is a list of FILENAME - 3 per line.

#!/bin/ksh

pav='/home/pav'
ssk='/home/ssk'

yourSQLscript | while read one two three junk
do
   mv "${one}" "${pav}"
   mv "${two}" "${ssk}"
   mv "${three}" "${ssk}"
done

the output of the sql script is:

DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400
DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400
DSA.WLG.20050711210100.20051025.20050711210100 25881 1130198400
DSA.WLG.20050711210100.20051025.20050711210100 28991 1130198400

then korn shell script has to move the 1st column:to /home/sk

DSA.WLG.20050713211544.20051025.20050713211544
DSA.WLG.20050713211544.20051025.20050713211544
DSA.WLG.20050711210100.20051025.20050711210100
DSA.WLG.20050711210100.20051025.20050711210100

the the 2nd column and 3rd column move to /home/ssk

28991 1130198400
25881 1130198400
25881 1130198400
28991 1130198400

i tried yours. read one two three..what is it i could not understand..
i will not get any headings from my sql script since i am using set heading off in my sql script.

can you please clarify..
Thanks & Regards

I don't quite understand what you've tried and what didn't work...
Can you elaborate, pls!