Sponsored Content
Top Forums Shell Programming and Scripting help in writing awk script, plz urgent Post 302123795 by LAKSHMI NARAYAN on Wednesday 27th of June 2007 08:40:08 AM
Old 06-27-2007
hey i am not getting this

awk '{if($0 ~ / ENDING /) printf("%s\n%s\n",$0,$0); else print $0;}' filename \

| awk -f interesting.awk



interesting.awk

BEGIN{i=0; flag=1; tag="" ;num=0;}

{if($0 ~ / ENDING /)

{ if(tag != $6)

{ num=0;

tag=$6;

}

++i;

if (flag == 1)

{ printf("%s %s %s %s %s %s %s) %s %s%d\n",$1,$2,$3,$4,$5,int((substr($6,1,length($6)-1)+num)/2),i);

flag = 0;

num=substr($6,1,length($6)-1);

}

else

{ printf("%s %s %s %s %s %s%d\n",$1,$2,$3,$4,$5,$6,$7,$8,substr($9,1,5),i);

flag = 1;

}

}

else print $0;



I HAVE TRIED LIKE THIS , BUT SOME WHERE THE PROBLEM IS OCCURRING
PLZ HELP IN THIS URGENTLY

}
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

urgent plz

guys i have sun solaries 8 under intel .. i added a new D-LINK ethernet and i need to see if the computer define it or not .. so i need to make reconfiguraion .. what was the command ... for reconfiguration ??? thanks alot (3 Replies)
Discussion started by: tamemi
3 Replies

2. UNIX for Dummies Questions & Answers

find command - Urgent Plz.

Hi, In my current directory, i have the following files: x1.dat x2.dat.gz x3.dat I want to use the find command and display only files which has *.dat and NOT *.gz extension files. Please help me out. Thanks, Kris Kart. (2 Replies)
Discussion started by: Kris_Kart_101
2 Replies

3. Shell Programming and Scripting

plz solve this one : URGENT

Hi! How to use awk command and set command in a shell script? Suppose I have to fetch data from a file and change one data with another one.Say data is ABCD.Now I have to change C with X .How do I solve this one? (2 Replies)
Discussion started by: joyita bagchi
2 Replies

4. Shell Programming and Scripting

plz help in writing awk script

hi buddies pls help in this matter i have file like this input file -------------------------- (PARTITION PARTITION_1 VALUES LESS THAN (101, 16383 ) TABLESPACE PART_1 ,PARTITION PARTITION_2 VALUES LESS THAN (101, 32766 ) TABLESPACE PART_2 ,PARTITION PARTITION_3 VALUES LESS THAN (101,... (3 Replies)
Discussion started by: LAKSHMI NARAYAN
3 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. UNIX for Dummies Questions & Answers

plz help me urgent....

i want shell script program for counting the no of times the given input word is occured in the given input file.i am unable to do this .i got some of output with awk but i need it completely with shell script program i am waiting for the solution (4 Replies)
Discussion started by: sankar_1209
4 Replies

7. 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

8. Shell Programming and Scripting

Clarify doubt ... plz Urgent

Hi friends, I am new to UNIX. I going to transfer files using SFTP. I am writing a script and using mget . If i am using mget * means, if all the files and their sub directories are transferred or not? If suppose , the local system dose not have the sub directory then what will... (1 Reply)
Discussion started by: punitha
1 Replies

9. Shell Programming and Scripting

error in shell script while returning values-- urgent issue plz help.

Hi, I have initailized a varaible EBID as typeset Long EBID=0 i am calculating value of EBID using certian formula as below: (( CURR_EBID= ($BANDINDEX << 27) | ($CURR_FREQ << 16) | ($CURR_CELLID << 4) | $CURR_SECTOR_VALUE )) return $CURR_EBID The output is as below: + (( CURR_EBID=... (6 Replies)
Discussion started by: kasanur
6 Replies

10. AIX

Need help..Urgent plz

Hi All, For listing large files i am using the following command find /XYZ/ -xdev -size +100000 |xargs ls -l |sort -nr -k 5..And my question is i am getting more number of files with this, so not able to copy those, how can I get those all in page by page , so that I can able to copy those... (4 Replies)
Discussion started by: adminaix55
4 Replies
gamma4scanimage(1)					      General Commands Manual						gamma4scanimage(1)

NAME
gamma4scanimage - create a gamma table for scanimage SYNOPSIS
gamma4scanimage gamma [shadow [highlight [maxin [maxout]]]] DESCRIPTION
The tool gamma4scanimage creates a gamma table in the format expected by scanimage. You can define a gamma, a shadow and a highlight value. You also can specify the size (maxin) and maximum output value (maxout) of the gamma table. gamma is a floating point value, neutral value is 1.0, if the value is larger than 1.0 then the image gets brighter. shadow defines the minmum input value that is necessary to create an output value larger than zero. shadow has to be in the range [0..maxin]. Its default value is 0. highlight defines the maximum input value that produces an output value smaller than maxout. highlight has to be in the range [0..maxin], highlight has to be larger than shadow. Its default value is the same as maxin (16383 if not set). maxin defines the size of the gamma table. The size depends on the scanner/backend. If the scanner uses 8 bits gamma input then maxin has to be set to 255, for 10 bits 1023, for 12 bits 4095, for 14 bits 16383. The default is 16383. To find out what value maxin has to be call scanimage with a very large gamma table [0]0-[99999]255 then scanimage prints an error message with the needed size of the gamma table. maxout defines the maximum output value. Take a look at the output of scanimage -h to find out what maxout has to be. The default value is 255. EXAMPLE
scanimage --custom-gamma=yes --gamma-table `gamma4scanimage 1.8 0 11500 16383 255` >image.pnm SEE ALSO
scanimage(7) AUTHOR
Oliver Rauch EMAIL-CONTACT Oliver.Rauch@Rauch-Domain.DE 11 Sep 2002 gamma4scanimage(1)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy