Sponsored Content
Top Forums Shell Programming and Scripting awk columnwise adjacent match checking program Post 302365954 by vasanth.vadalur on Wednesday 28th of October 2009 11:49:26 AM
Old 10-28-2009
awk columnwise adjacent match checking program

Hi,

For the below problem, awk script is needed..

input file :
Code:
jill
jack
jill
jill
jack
jill
jack
jill

Required:
here,
i need to check from first line.
reference is jack. jill need to verified with next line jack. if found print
Code:
jill & jack combination hill1 
jack & jill & jill & jack combination hill2
jack&jill&jack combination hill3
jack &jill combination hill1


Thanks in advance
vasanth


Last edited by radoulov; 10-28-2009 at 04:47 PM.. Reason: Use code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk with paste ... columnwise

Hi, I'm trying to plot some data using the awk to find and parse the data and then use gnuplot to plot it up. I'd like to plot one or more range cells (let the user decide!). I've been able to write up the code such that I can plot one range cell per plot, but I just can't see how to get more... (1 Reply)
Discussion started by: dpath2o
1 Replies

2. Shell Programming and Scripting

Checking whether program is installed

I currently use this construction to check whether a certain program is installed: if ; then cd /usr/ports/databases/sqlite3 && make install clean else echo "sqlite already installed" fi Is this method recommended? Is this an effective method, ie sufficiently robust for... (3 Replies)
Discussion started by: figaro
3 Replies

3. UNIX for Advanced & Expert Users

Checking mem usage at specific times in a program

Hi all, I'm running a simulator and I'm noticing an slow increase in memory for long simulations such that the simulation has to end because of a lack of memory. A colleague of mine ran Valgrind memcheck and reported that nothing of interest was reported other than known mem leaks. My advisor... (2 Replies)
Discussion started by: pl4u
2 Replies

4. Emergency UNIX and Linux Support

[Solved] AWK to parse adjacent matching lines

Hi, I have an input file like F : 0.1 : 0.002 P : 0.3 : 0.004 P : 0.5 : 0.008 P : 0.1 : 0.005 L : 0.05 : 0.02 P: 0.1 : 0.006 P : 0.01 : 0.08 F : 0.02 : 0.08 Expected output: (2 Replies)
Discussion started by: vasanth.vadalur
2 Replies

5. UNIX for Dummies Questions & Answers

Short Program for Checking Server date

Hi Guys, Good morning! I have a file which looks something like this: Command was launched from partition 0. ------------------------------------------------ Executing command in server server3 Thu Jan 12 11:10:39 EET 2012 ------------------------------------------------... (3 Replies)
Discussion started by: rymnd_12345
3 Replies

6. UNIX for Dummies Questions & Answers

awk display the match and 2 lines after the match is found.

Hello, can someone help me how to find a word and 2 lines after it and then send the output to another file. For example, here is myfile1.txt. I want to search for "Error" and 2 lines below it and send it to myfile2.txt I tried with grep -A but it's not supported on my system. I tried with awk,... (4 Replies)
Discussion started by: eurouno
4 Replies

7. Shell Programming and Scripting

Program to combine two lines in a file on checking the first character of each line

Hi, I have a requirement where I need to combine two lines in a file based on first character of each line in a file. Please find the sample content of the file below: _______________________ 5, jaya, male, 4-5-90, single smart 6, prakash, male, 5-4-84, married fair 7, raghavi, female,... (12 Replies)
Discussion started by: jayaP
12 Replies

8. Shell Programming and Scripting

awk to match field between two files and use conditions on match

I am trying to look for $2 of file1 (skipping the header) in $2 of file2 (skipping the header) and if they match and the value in $10 is > 30 and $11 is > 49, then print the line from file1 to a output file. If no match is foung the line is not printed. Both the input and output are tab-delimited.... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

awk to update file based on partial match in field1 and exact match in field2

I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output. $1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

awk to print match or non-match and select fields/patterns for non-matches

In the awk below I am trying to output those lines that Match between file1 and file2, those Missing in file1, and those missing in file2. Using each $1,$2,$4,$5 value as a key to match on, that is if those 4 fields are found in both files the match, but if those 4 fields are not found then missing... (0 Replies)
Discussion started by: cmccabe
0 Replies
JACK.PLUMBING(1)														  JACK.PLUMBING(1)

NAME
jack.plumbing - JACK Plumbing Daemon SYNOPSIS
jack.plumbing [options] [rule-files] OPTIONS
-d : Do not operate as a daemon. -o : Do not load ordinary rule files. -q : Quiet operation. -u : Set the time, in micro-seconds, that must elapse after a connection notification to indicate the end of a notification set (default=30000). This is an optimization switch. DESCRIPTION
jack.plumbing maintains a set of port connection rules and manages these as clients register ports with JACK. Port names are implicitly bounded regular expressions and support sub-expression patterns. There are four rules: connect, disconnect, also-connect and connect-exclusive. (connect "SuperCollider:out_(.*)" "system:playback_1") This connect rule ensures that whenever scsynth(1) is running any output ports it registers are connected to appropriate ALSA playback ports. The connect rule only makes a connection if none already exist. (also-connect "system:playback_1" "jack.udp-[0-9]*:in_1") This also-connect rule ensures that when jack.udp(1) is running in send mode all signals that are ordinarily sent to the local audio interface will also be sent to the network destination. The also-connect aliasing applies to both the left and right hand side of connect rules. (connect-exclusive "SuperCollider:out_(.*)" "ardour:sc3_in_1/in 1") This connect-exclusive rule ensures that if SuperCollider and an ardour(1) session with appropriate tracks are both running that SuperCollider gets connected to ardour and disconnected from everything else. This type of connection daemon has the following advantages over both environment variables and command line arguments: o it does not require any client connection support or logic at all o it provides a uniform user interface to all clients o it has a somewhat declarative style This type of daemon is very lightweight and non-intrusive: it requires no arguments, it runs from an unprivileged thread, if the rule set is empty it is a no-op, it does not write any files, it does not require any modification to clients or to how clients are started. When a set of port registrations is made it checks the modification time of the rule set files, /etc/jack.plumbing and ~/.jack.plumbing, and any files specified by the user, rereads the rule set if it has been updated, then makes the JACK graph obey the rules. Any lines beginning with a semi-colon are ignored. The rule set is sorted, disconnect rules are applied first, then connect rules, then connect-exclusive rules. FILES
o /etc/jack.plumbing o ~/.jack.plumbing AUTHOR
Written by Rohan Drape http://slavepianos.org/rd/ SEE ALSO
jackd(1) AUTHOR
Rohan Drape <rd@slavepianos.org> Author. 01/10/2012 JACK.PLUMBING(1)
All times are GMT -4. The time now is 06:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy