Sponsored Content
Full Discussion: range patterns in awk
Top Forums Shell Programming and Scripting range patterns in awk Post 302481919 by ghoda2_10 on Monday 20th of December 2010 07:50:29 AM
Old 12-20-2010
Below are two functions in the file
Code:
function $reset_report(), invisible
{
 a = set_value;
 return @true;
}

function $reset_palette_menu(),INDIRECT
{
  if ( v == "")
    $notify(message1, @warning);
  else {
    $replace_palette();
   }
 b = value; 
}

and I need the output to be:
Code:
function $reset_palette_menu(),INDIRECT
{
  if ( v == "")
    $notify(message1, @warning);
  else {
    $replace_palette();
   }
 b = value; 
}

but the command I wrote above only prints the function until the first "}":
Code:
function $reset_palette_menu(),INDIRECT
{
  if ( v == "")
    $notify(message1, @warning);
  else {
    $replace_palette();
   }


Last edited by Scott; 12-20-2010 at 09:06 AM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

AWK: Multiple patterns per line

Hi there, We have been given a bit of coursework using awk on html pages. Without giving too much away and risking the wrath of the plagerism checks, I can say we need to deal with certain html elements. There may be several of these elements on one line. My question is, if there are more... (1 Reply)
Discussion started by: Plavixo
1 Replies

2. Shell Programming and Scripting

print range between two patterns if it contains a pattern within the range

I want to print between the range two patterns if a particular pattern is present in between the two patterns. I am new to Unix. Any help would be greatly appreciated. e.g. Pattern1 Bombay Calcutta Delhi Pattern2 Pattern1 Patna Madras Gwalior Delhi Pattern2 Pattern1... (2 Replies)
Discussion started by: joyan321
2 Replies

3. Shell Programming and Scripting

range in if using awk

Hi All, I would like to assign the following values to each column in my file. if $i is between 1 and -1 (ie -1 < $i < 1) then print A; if $i is between -2 and -1 && 1 and 2 (ie. -2 < $i < -1 && 1 < $i < 2) then print B; if $i is between -3 and -2 && 2 and 3 (ie. -3 < $i < -2 && 2 < $i < 3)... (1 Reply)
Discussion started by: Fredrick
1 Replies

4. Shell Programming and Scripting

[Solved] HP-UX awk sub multiple patterns

Hi, I am using sub to remove blank spaces and one pattern(=>) from the input string. It works fine when I am using two sub functions for the same. However it is giving error while I am trying to remove both spaces and pattern using one single sub function. Working: $ echo " OK => " |awk... (2 Replies)
Discussion started by: sai_2507
2 Replies

5. Shell Programming and Scripting

awk comparison with two patterns

Here is my list, which contains URLs for file downloads: //servername.com/version/panasonic1,1_1.1.1 //servername.com/version/panasonic3,1_6.7.1 //servername.com/version/panasonic3,2_6.8 //servername.com/version/panasonic2,6_3.0.2 //servername.com/version/panasonic3,1_7.1.3... (5 Replies)
Discussion started by: ibanezpete
5 Replies

6. Shell Programming and Scripting

Searching multiple patterns using awk

Hello, I have the following input file: qh1adm 20130710111201 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ qh1adm 20130711151154 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ qx1adm 20130711151154 : tp count QX1 u6 -Dsourcesystems=B17,E17,EE7 qh1adm 20130711151155 : tp import all... (7 Replies)
Discussion started by: kcboy
7 Replies

7. Shell Programming and Scripting

Specifying patterns to egrep or awk

given this information: ^\w{3} {11} -]+ kernel:( \]+\.]+\])? ]+: media error \(bad sector\): status=0x]+ { DriveReady SeekComplete Error }$ ^\w{3} {11} -]+ kernel:( \]+\.]+\])? end_request: I/O error, dev ]+, sector ]+ i need to set up monitoring for these strings. but as you can see, they... (2 Replies)
Discussion started by: SkySmart
2 Replies

8. Shell Programming and Scripting

awk search patterns from file in another

I would like to grep for aaa and bbb and ccc from one line in file1.txt in any order on a line on file2.txt file1.txt aaa bbb ccc ddd fff ggg hhh ddd jjj jjj cccfile2.txt aaa bbb ccc ddd fff ggg --> output whole line since it matches with aaa bbb ccc of file1.txt aaa ddd jjj hhh --> no... (1 Reply)
Discussion started by: sdf
1 Replies

9. UNIX for Beginners Questions & Answers

TCL script to print range of lines between patterns

Hi I am having a code as stated below module abcd( a , b , c ,da , fa, na , ta , ma , ra , ta, la , pa ); input a , b, da ,fa , na , ta , ma; output c , ra ,ta , la ,pa ; wire a , b , da , fa ,na , ta , ma; endmodule I need to match the string... (1 Reply)
Discussion started by: kshitij
1 Replies

10. UNIX for Beginners Questions & Answers

Match patterns between two files and extract certain range of strings

Hi, I need help to match patterns from between two different files and extract region of strings. inputfile1.fa >l-WR24-1:1 GCCGGCGTCGCGGTTGCTCGCGCTCTGGGCGCTGGCGGCTGTGGCTCTACCCGGCTCCGG GGCGGAGGGCGACGGCGGGTGGTGAGCGGCCCGGGAGGGGCCGGGCGGTGGGGTCACGTG... (4 Replies)
Discussion started by: bunny_merah19
4 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgawk | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for gawk is available on http://opensolaris.org. Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy