Sponsored Content
Top Forums Shell Programming and Scripting plz help in writing awk script Post 302126823 by Shell_Life on Friday 13th of July 2007 09:29:39 AM
Old 07-13-2007
If I understand your code correctly, it is adding 4096, but your
example is not being consistent:
Code:
,PARTITION PARTITION_4 VALUES LESS THAN (101, 16383 ) TABLESPACE PART_4
,PARTITION PARTITION_5 VALUES LESS THAN (101, 20478 ) TABLESPACE PART_5

It should be:
Code:
,PARTITION PARTITION_4 VALUES LESS THAN (101, 16383 ) TABLESPACE PART_4
,PARTITION PARTITION_5 VALUES LESS THAN (101, 20479 ) TABLESPACE PART_5

Other numbers should be changed too.

In any event, see if this works for you:
Code:
typeset -i mCnt1=1
typeset -i mCnt2=4095
mVar='101'
while [ $mCnt1 -le 24 ]
do
 if [ $mCnt1 -eq 17 ]; then
   mVar='102'
   mCnt2=4095
 fi
 mPart1='PARTITION PARTITION_'${mCnt1}' VALUES LESS THAN ('${mVar}
 mPart2=', '${mCnt2}' ) TABLESPACE PART_'${mCnt1}
 echo ${mPart1}${mPart2}
 mCnt1=${mCnt1}+1
 mCnt2=${mCnt2}+4096
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

plz Help How should I configure cc compiler output file plz help???

i.e configuration of C compiler :confused: (4 Replies)
Discussion started by: atiato
4 Replies

2. Shell Programming and Scripting

hi help in writing awk script(urgently)

hi to all i have file like this file.txt this is naryana expect hyderabad is a cool place now climate VISAKHSAPATNAM became very cool #vizag is my birth place #hyderabad is a cool place #now climate of hyd became very cool #vizag is my birth place #hyderabad is a cool place ... (7 Replies)
Discussion started by: LAKSHMI NARAYAN
7 Replies

3. Shell Programming and Scripting

help in writing awk script, plz urgent

I have a file like this I have to I have input file this , I want to give the out put in the below input file (NARAYANA 1 ENDING AT (100, 16383) ,NARAYANA 2 ENDING AT (100, 32766) ,NARAYANA 3 ENDING AT (100, 49149) ,NARAYANA 4 ENDING AT (100, 65535) ,NARAYANA 5... (8 Replies)
Discussion started by: LAKSHMI NARAYAN
8 Replies

4. Shell Programming and Scripting

Help needed in writing awk script for xml source

Hi, i am not able to get an approach for converting xml file to flat file using awk programming. Can anyone help me out. The input xml is like this: <outer> <field1>one</field1> <field2>two</field2> <field3>three<Error Code=777 Description=12345/></field3> <field4>four</field4> </outer>... (2 Replies)
Discussion started by: naren_0101bits
2 Replies

5. Solaris

plz help me in writing a script

Hi all, I want to write a script which gather all files who where having a particular name.The script should run at the end of each month. The files(Audit and health files) are generated each day. I want to gather the files seperately into corresponding folders and so that i can ftp'ed... (3 Replies)
Discussion started by: Renjesh
3 Replies

6. Shell Programming and Scripting

Explain this AWK script plz

Hi frnds, one my frnds has given resolution for my problem as below. it working great , but i couldnt understand somethings in the script. Why ++ operator after the function calling. how these each block working. will each run for each input line sequencially or one block for all the lines... (9 Replies)
Discussion started by: Gopal_Engg
9 Replies

7. Shell Programming and Scripting

Help in writing a find/replace script using awk

Hi All, I need to write a script that will go through 600+ files and perform find and replace. I was going to use sed but there is a level of complexity that is doing my head in. To explain: I have 600+ files that have a line in them that reads (for example) FILE=DCLCLHST... (4 Replies)
Discussion started by: Kocko
4 Replies

8. UNIX for Dummies Questions & Answers

Writing awk script to read csv files and split them

Hi Here is my script that calls my awk script #!/bin/bash set -x dir="/var/local/dsx/csv" testfile="$testfile" while getopts " f: " option do case $option in f ) testfile="$OPTARG";; esac; done ./scriptFile --testfile=$testfile >> $dir/$testfile.csv It calls my awk... (1 Reply)
Discussion started by: ladyAnne
1 Replies

9. UNIX for Dummies Questions & Answers

awk: issues for writing a script

%%%%% (7 Replies)
Discussion started by: lucasvs
7 Replies

10. Shell Programming and Scripting

help with writing a awk/sed script

Hi, I thought I am getting pretty good with sed and awk, but now I dont have a way out of this question. I have a table 0.5 16 1.3 14 0.25 15 0.85 16 I want to make a column 3 which contains values that are (corresponding $2 value/sum of all $2). Please help me out here. Thanks. (6 Replies)
Discussion started by: jamie_123
6 Replies
All times are GMT -4. The time now is 03:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy