Help with approach and developing script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with approach and developing script
# 1  
Old 04-21-2015
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
# 2  
Old 04-21-2015
I need a clarification.

What is your question?

We can help with the details but cannot do this all for you step-by-step.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Developing Applications for UNIX.COM

A number of people have asked me about the best way to develop some cool new web app for UNIX.COM. In today's "very easy web dev" world, developers do not need to be burdened (like I am) to the "back end" of the site. The best way to develop web apps is to build the application on your desktop... (2 Replies)
Discussion started by: Neo
2 Replies

2. UNIX for Beginners Questions & Answers

What is the right approach to take?

Hello every one, I will love to know what is the best approach to take in obtaining books online. I find it disturbing just googling a book online and downloading it without actually paying for it. I strongly believe that this is wrong and that i may not be able to unlock the key contents and... (2 Replies)
Discussion started by: despiragado
2 Replies

3. Red Hat

What would be the best approach?

I have a table in one of my DB. The DB is about 300 gig - of that 249 gig is in this table. The data is somewhat important but even if we delete half of it won't affect anybody. I would like to reclaim some space back so my question is what would be the best approach to accomplish this task.... (6 Replies)
Discussion started by: newborndba
6 Replies

4. UNIX for Dummies Questions & Answers

Help for developing script

I want to develop a unix script. Scenario:A folder is containing many text files and there is one text file eg. test.csv which is having 2 words at line 1 & line 2.The script should search for word at line 1 in test.csv file in all other text file present in folder & replace it with word at line 2... (5 Replies)
Discussion started by: Anna Cardoz
5 Replies

5. Shell Programming and Scripting

Need advice on approach for script

Greetings all. I have a repository server which receives, without exhaggeration, several million files a week. The majority of these files are in .csv format, which means they're highly compressable. They are spread throughout numerous directories where there are configured monitoring utilities... (4 Replies)
Discussion started by: msarro
4 Replies

6. Shell Programming and Scripting

Help in developing an awk code

#!/bin/ksh set -x FILENAME=$1 #To calculate debit and credit DEBIT=`awk -F, '{value=$28 ;if(value<0) {debit+=value}} END {print debit}' $FILENAME` CREDIT=`awk -F, '{value=$28 ;if(value>0) {credit+=value}} END {print credit}' $FILENAME` #This part is not working since the debit value is... (2 Replies)
Discussion started by: selvankj
2 Replies

7. SuSE

Write shell script using menu-driven approach to show various system

QUESTION: Write shell script using menu-driven approach to show various system configuration like 1) Currently logged user and his logname 2) Your current shell 3) Your home directory 4) Your current path setting 5) Your current working directory 6) Show Currently logged number of... (1 Reply)
Discussion started by: bboyjervis
1 Replies

8. Shell Programming and Scripting

Developing own shell

Hi everyone.I am trying ti create my own shell in C.So far i have managed to create a parser to separate args from cmd line of my shell.(i have done nothing different for tokens is that wrong?).so i can run commands like "ls -l" "cp" "cat" etc.now i want to add redirection.can anyone guide me... (1 Reply)
Discussion started by: bashuser2
1 Replies

9. Shell Programming and Scripting

Approach to writting a script

Hello all, I've just joined. I did a google search and your site came up, I had a look and thought I'd like to become a member. I'm from Ireland. I've written a few scripts before, but this new task has me foxed. I would like to figure out the best approach to achieving the following ... (15 Replies)
Discussion started by: Bloke
15 Replies

10. Shell Programming and Scripting

Can you help me regarding developing script?

Hi All, I want to develope this script. any help will be appreciated. It is possible to use two pipes and create two-way communication between two processes. (In practice, this is not done because sockets are available.) Create a program where the parent process reads the name of a language... (2 Replies)
Discussion started by: vishalpatel03
2 Replies
Login or Register to Ask a Question