Visit Our UNIX and Linux User Community


awk columnwise adjacent match checking program


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk columnwise adjacent match checking program
# 1  
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 05:47 PM.. Reason: Use code tags, please!

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
GXTUNER(1)						      General Commands Manual							GXTUNER(1)

NAME
gxtuner - a tuner for jackd SYNOPSIS
gxtuner DESCRIPTION
This manual page documents briefly the gxtuner program. This manual page was written for the Debian distribution because the original pro- gram does not have a manual page. gxtuner is a simple, small and lightweight guitar/bass tuner connected through Jack Audio Connection Kit. gxtuner comes with a analogue like interface (scale), show the tune (char) and the accumulated frequency (Hz). OPTIONS
-h Display short info --help-all Show all help options --help-gtk GTK configuration options --help-jack JACK configuration options --help-engine ENGINE configuration options GTK configuration options -x --posx=POSITION_X window position x-axis ( -x 1 -> . .) -y --posy=POSITION_Y window position y-axis ( -y 1 -> . . ) -w --wigth=WEIGTH 'default' wigth ( -w 120 -> . .) -l --height=HEIGHT 'default' height ( -l 100 -> . .) -d --desktop=NUM set to virtual desktop num JACK configuration options -i --jack-input=PORT gxtuner JACK input e.g. gxtuner -i system:capture_3 gxtuner -i gx_head_amp:out_0 -U --jack-jack-input=UUID gxtuner JACK session UUID ENGINE configuration options -p --pitch=PITCH set reference pitch ( -p 415,0 <-> 467,0) -t --threshold=THRESHOLD set threshold level (-t 0,001 <-> 0,5) SEE ALSO
jackd(1). AUTHOR
This manual page was written by Jaromir Mike <mira.mikes@seznam.cz>, for the Debian project (but may be used by others). January 28, 2011 GXTUNER(1)

Featured Tech Videos