LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shell script (https://www.linuxquestions.org/questions/linux-newbie-8/shell-script-891259/)

linuxred 07-12-2011 05:33 AM

shell script
 
Hi,
need to write awk program for the following scenario.
This is input file for eg:(3rd field can be any thing)

tablea|indexa|cola|pos1
tablea|indexb|colb|pos1
tablea|indexb|colc|pos2
tablea|indexb|cola|pos3
tableb|indexc|coln|pos1

In the above data we have distinct 2 values for field 1 i.e. tablea and tableb. And fourth filed gets incremented by 1 for the same value in field 2.

Now we need to have awk script which produces files per field 1 this case:
<file 1>
create index indexa on tablea (cola);
cretae index indexb on tablea(colb,colc,cola)

<file 2>
create index indexc on tableb(coln);

grail 07-12-2011 08:41 AM

Sounds like a plan ... what have you done so far and where are you stuck?

colucix 07-12-2011 09:10 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Continue here: http://www.linuxquestions.org/questi...script-891267/


All times are GMT -5. The time now is 02:44 AM.