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 04:47 PM.. Reason: Use code tags, please!
Login or Register to Ask a Question

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
Login or Register to Ask a Question
JACK-KEYBOARD(1)														  JACK-KEYBOARD(1)

NAME
jack-keyboard - A virtual keyboard for JACK MIDI SYNOPSIS
jack-keyboard [ -C ] [ -G ] [ -K ] [ -T ] [ -V ] [ -a input port ] [ -k ] [ -r rate ] [ -t ] [ -u ] [ -c channel ] [ -b bank ] [ -p program ] [ -l layout ] OPTIONS
-C Enable "keyboard cue" - two horizontal lines over a part of keyboard; keys under the lower line are mapped to the lower row of your PC keyboard; keys under the upper line are mapped to the upper row. -G Disable GUI. It makes jack-keyboard look like it did before version 2.0. -K Grab the keyboard. This makes jack-keyboard receive keyboard events even when it does not have focus. In other words, you can play while mousing in a different window. Note: It's not reliable yet. It does not work when some other application keeps the keyboard grabbed. It does not work with GNOME. Even when it seems to work, some keyboard events may get lost. -T Toggle titlebar, on which channel/bank/program information is shown. With -G option, it disables titlebar; otherwise it enables it. -V Print version number to standard output and exit. -a input port Automatically connect to the named input port. Note that this may cause problems with LASH. -k Allow connecting to other instances of jack-keyboard (see PIANOLA MODE below). Without this option, jack-keyboard will refuse to connect to any JACK client whose name starts in "jack-keyboard"; this is to prevent loops. Note that it's impossible to connect instance of jack-keyboard to itself, even with this option set. -r rate Set rate limit to rate, in Kbaud. Limit defined by the MIDI specification is 31.25. By default this parameter is zero, that is, rate limiting is disabled. -t Send all MIDI messages with zero time offset, making them play as soon as they reach the synth. This was the default behavior before version 1.6. -u By default, jack-keyboard does not send program/bank change messages after reconnecting, so the newly connected instrument remains at previous settings. This option changes that behaviour. -c channel Set initial MIDI channel to channel; by default it's 1. -b bank Set initial MIDI bank to bank. With this option, jack-keyboard will send the bank/program change once, when it connects. -p program Set initial MIDI program to program. With this option, jack-keyboard will send the bank/program change once, when it connects. -l layout Specify the layout of computer keyboard being used. Valid arguments are QWERTY, QWERTZ, AZERTY, and DVORAK. Default is QWERTY. DESCRIPTION
jack-keyboard is a virtual MIDI keyboard - a program that allows you to send JACK MIDI events (play ;-) using your PC keyboard. It's some- what similar to vkeybd, except it uses JACK MIDI instead of ALSA, and the keyboard mapping is much better - it uses the same layout as trackers (like Impulse Tracker) did, so you have two and half octaves under your fingers. KEY BINDINGS
Keyboard mapping is the same as in Impulse Tracker. This is your QWERTY keyboard: +----+----+ +----+----+----+ +----+----+ | 2 | 3 | | 5 | 6 | 7 | | 9 | 0 | +----+----+----+----+----+----+----+----+----+----+ | Q | W | E | R | T | Y | U | I | O | P | +----+----+----+----+----+----+----+----+----+----+ | S | D | | G | H | J | +----+----+----+----+----+----+----+ | Z | X | C | V | B | N | M | +----+----+----+----+----+----+----+ And this is MIDI mapping: +----+----+ +----+----+----+ +----+----+ |C#5 |D#5 | |F#5 |G#5 |A#5 | |C#6 |D#6 | +----+----+----+----+----+----+----+----+----+----+ | C5 | D5 | E5 | F5 | G5 | A5 | B5 | C6 | D6 | E6 | +----+----+----+----+----+----+----+----+----+----+ |C#4 |D#4 | |F#4 |G#4 |A#4 | +----+----+----+----+----+----+----+ | C4 | D4 | E4 | F4 | G4 | A4 | B4 | +----+----+----+----+----+----+----+ Spacebar is a sustain key. Holding it when pressing or releasing key will make that key sustained, i.e. Note Off MIDI event won't be sent after releasing the key. To release (stop) all the sustained notes, press and release spacebar. Holding Shift when pressing note will make it louder (it increases velocity). Holding Ctrl will do the opposite. You can change the default velocity by moving the Velocity slider. You can change the "high" and "low" velocity values by moving the slider while holding Shift or Ctrl keys. Pressing "-" and "+" keys on numeric keypad changes the octave your keyboard is mapped to. Pressing "*" and "/" on numeric keypad changes MIDI program (instrument). Pressing Insert or Delete keys will connect jack-keyboard to the next/previous MIDI input port (it will cycle between running instances of ghostess, for example). Home and End keys change the MIDI channel. Page Up and Page Down keys switch the MIDI bank. Esc works as a panic key - when you press it, all sound stops. SETTING CHANNEL
/BANK/PROGRAM NUMBER DIRECTLY To switch directly to a channel, bank or program, enter its number on the numeric keypad (it won't be shown in any way) and press Home or End (to change channel), Page Up or Page Down (to change bank) or "/" or "*" (to change program). For example, to change to program number 123, type, on the numeric keypad, "123/", without quotes. TITLEBAR
When -G xor -T is given, some informational messages in the title bar appear. They are supposed to be self explanatory. If you see "bank/program change not sent", it means that the bank/program numbers as seen in the title bar were not sent. In other words, synth the jack-keyboard is connected to may use different values. This happens at startup and after switching between synths (using Insert/Delete keys). To send bank/program change at startup, use -b and -p parameters. To automatically send bank/program change after reconnect, use the -u option. PIANOLA MODE
In addition to the MIDI output port, jack-keyboard also opens MIDI input (listening) port. MIDI events going into this port will be passed to the output port unmodified, except for channel number, which will be set to the one jack-keyboard is configured to use. Note On and Note Off MIDI events will cause visible effect (pressing and releasing) on keys, just like if they were being pressed using keyboard or mouse. jack-keyboard will never connect to it's own MIDI input port. It will also refuse to connect to any other client whose name begins in "jack-keyboard", unless the "-k" option is given. It is, however, possible to connect these ports manually, using jack_connect or qjackctl; this may create feedback loop. SEE ALSO
jackd(1), ghostess(1), qjackctl(1) BUGS
Key grabbing is unreliable. Many PC keyboards have problems with polyphony. For example, with the one I'm using right now, it's impossible to press "c", "v" and "b" at the same time. It's a hardware problem, not the software one. The spin widgets used to set channel/bank/program number don't take focus, so the value cannot be entered into them in the usual way. It's because jack-keyboard already uses numeric keys for different purposes. You can still directly enter channel/bank/program in a way described above. jack-keyboard 2.4 20 April 2008 JACK-KEYBOARD(1)