Sponsored Content
Top Forums Shell Programming and Scripting specifying multiple conditions in AWK Post 302420740 by skyineyes on Wednesday 12th of May 2010 10:31:09 AM
Old 05-12-2010
thanks
Quote:
Originally Posted by scottn
Hi.

Something like:
Code:
awk -F ';' '($2 == "ABCD") && ($3 == "MNOP") && ($4 == "KLPM") { print $2, $3;}'  file.xml

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

multiple conditions in if statements

Hi all, I'm confused about the proper syntax for multi-conditional if then statements. I'm trying to set limitations on info input on the command line.. i.e. if ] ;then $x=$vr1 else print "You have entered an invalid option." Can someone please clue me in on what is wrong with my syntax;... (3 Replies)
Discussion started by: tim mauger
3 Replies

2. UNIX for Dummies Questions & Answers

multiple conditions in if/then

Hello, I am having trouble with the syntax with a conditional statement in a BASH script involving multiple conditions. Any suggestions would be greatly appreciated! if ; then array=("${array}" "$dnNum" ) fi i receive this error: ./testscript: ' (4 Replies)
Discussion started by: grandtheftander
4 Replies

3. Shell Programming and Scripting

multiple if conditions

Guys, Im trying to have a script that evaluates multiple conditions : test.sh: if then echo "host $1" else if then echo "host $1" else echo $1 not valid exit 1 fi when I do ./test.sh brazil1 I get: (4 Replies)
Discussion started by: bashshadow1979
4 Replies

4. Shell Programming and Scripting

Help regarding multiple conditions

Hi All, I am new to shell scripting. Can any one say what is wrong in this if statement, that uses multiple conditions if then *************** else if ( -z $pcs && "$night_time_calc" > "$night_time" ) then ******************************** ... (4 Replies)
Discussion started by: ssenthilkumar
4 Replies

5. UNIX for Dummies Questions & Answers

If + multiple conditions

Hello Unix-Forums! It has been a long time since my last post, but finally I've got a new question: I know in case you can use multiple patterns by case $var in a|b|c|ab) and so on. But how would I place an OR between if ] then ... if ] then ... I want to execute the "..." if... (3 Replies)
Discussion started by: intelinside
3 Replies

6. Shell Programming and Scripting

awk multiple search and if conditions

Hi I wanted to search for 2 patterns. These patterns are matched only if the if condition is matched for example: This is the kind of command that I have in mind which is obviously not correct: awk '/abc/ if ($1>10) {print);/xyz/ if ($2>5) {print)' myfile myfile: 12 14 3 20 45 abc 21 ... (7 Replies)
Discussion started by: zorrox
7 Replies

7. Shell Programming and Scripting

Using awk to parse multiple conditions

There are 4 ways the user can input data and unfortunately the parse rules for each are slightly different. The first condition works great and the input file is attached for the second condition. Conditions 3 and 4 will follow I'm sure I will have trouble with them and need help as well. The... (9 Replies)
Discussion started by: cmccabe
9 Replies

8. Shell Programming and Scripting

Multiple conditions in IF

Fellas, Am new to unix os/ and here the situation , I am trying to write multiple condition statement inside if but it throws me a error here is my piece of code , if ] && ] && ] then commands fi error : line 15 : ` can someone please advise me how to fix it Please use... (7 Replies)
Discussion started by: xeccc5z
7 Replies

9. Shell Programming and Scripting

awk to change value of field using multiple conditions

In the below awk in the first step I default Classification NF-1 to VUS. Next, I am trying to change the value of Classification (NF) to whatever CLINSIG (NF-1) is. If there is only one condition everything works great, but if there are two conditions it does not work. Is the syntax used... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. UNIX for Beginners Questions & Answers

Multiple If conditions

I am analyzing one of the scripts written by another person.script is having multiple if conditions and everything are nested.The code is not formatted properly.Is there any way to identify in Unix to identify begin and end of a particular if block? (6 Replies)
Discussion started by: vamsi.valiveti
6 Replies
DOTTY(1)                                                      General Commands Manual                                                     DOTTY(1)

NAME
dotty - A Customizable Graph Editor SYNOPSIS
dotty [ -V ] [ file ] DESCRIPTION
dotty is a graph editor for the X Window System. It may be run as a standalone editor, or as a front end for applications that use graphs. It can control multiple windows viewing different graphs. dotty is written on top of dot and lefty. lefty is a general-purpose programmable editor for technical pictures. It has an interpretive programming language similar to AWK and C. The user interface and graph editing operations of dotty are written as lefty functions. Pro- grammer-defined graph operations may be loaded as well. Graph layouts are made by dot, which runs as a separate process that communicates with lefty through pipes. USAGE
The file name is optional. If present, the graph contained in that file is displayed in the dotty window. OPTIONS
-V Prints the version. SEE ALSO
dot(1), lefty(1) dotty user guide. DOTTY(1)
All times are GMT -4. The time now is 11:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy