Help with approach and developing script

Hi-
I need to develop a script for following scenario in AIX and K shell environment.I am from windows server background for most my career ,so please bear with me and advise suitable approach and technical assistance.Having said that I am aware of unix shell commands but never pput together at scripting level.

My scenario is::

step1)Extract data(I have a custom query that runs against a view) from postgreSQL database to a file called F1.I will need to use psql command line option.

step2)File F1 consists of 3 columns(C1,C2 and C3) and may contain any no of rows.(range between 1000-25,000).

  Step2-A\) Now I need run a external utility\(u1.exe program\) for each column C1 value in file F1 and write the output to another file F2.
  Step2-B\) F2 file should consist of only one column\(i.e C1\).Basically the values for C1 in F2 at this point is converted to a different value when run through utility u1.exe.

step3)Now,I need to pass each value in file F2 through another utility u2.exe that has specific argument. (This step sets some hold flag for me in the database for each corresponding value of F2).

step4)I need to run similar process as above(step3) but with a different set of argument (This step sets some delete flag for me in the database for each corresponding value in F2).

This ends my process.

Note:
->At each step,I am looking to have a verbose log file.
->Utility U1.exe and u2.exe are command line utilities from a different application
->C1 value is number type column

Kindly let me know if you need any clarifications.

Thanks,
Niras

I need a clarification.

What is your question?

We can help with the details but cannot do this all for you step-by-step.