AWK match $1 $2 pattern in file 1 to $1 $2 pattern in file2
Hi, I have 2 files that I have modified to basically match each other, however I want to determine what (if any) line in file 1 does not exist in file 2. I need to match column $1 and $2 as a single string in file1 to $1 and $2 in file2 as these two columns create a match.
I'm stuck in an AWK command and can't get any further. Below is an example of my 2 files. Note the difference in the 2 files: file1 has TEST in $1 on a line and has an additional line at the bottom where $1 match in both files but $2 does not.
I can't figure out how to match both $1 and $2 as 1 string in both files. $1 in file1 might exist in file2 but $1 and $2 must match each other. If not determine which line does not exist.
File1 row is same as column 2 in file 2.
Also file 2 will either start with A, B or C.
And 3rd column in file 2 is always F2.
When column 2 of file 2 matches file1 column, print all those rows into a separate file.
Here is an example.
file 1:
100
103
104
108
file 2:
... (6 Replies)
Hi,
I know how to use awk to search some expressions like five consecutive numbers, , this is easy.
However, how do I make awk print the pattern that is been matched?
For example:
input: usa,canada99292,japan222,france59664,egypt223
output:99292,59664 (6 Replies)
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hello Guyz
I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline
ABC
DEF
LMN
EFG
HIJ
LMN
OPQ
In the above text i need to... (8 Replies)
Hi experts , im new to Unix,AWK ,and im just not able to get this right.
I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
I want to read from file 1 and pattern match in file two and print field two from the next line.
File 1:
user1
user2
user3
File 2:
name=user1
gud=12345
name=user2
gud=32456
I have this pattern hardcoded but can't work out how to pass file 1 to the pattern match: (6 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
In the awk, thanks you @RavinderSingh13, for the help in below, hopefully it is close as I am trying to update the value in $12 of the tab-delimeted file2 with the matching value in $1 of the space delimeted file1. I have added comments for each line as well. Thank you :).
awk
awk '$12 ==... (10 Replies)
Discussion started by: cmccabe
10 Replies
LEARN ABOUT DEBIAN
mopd
MOPD(8) BSD System Manager's Manual MOPD(8)NAME
mopd -- MOP Loader Daemon
SYNOPSIS
mopd [-adf] [interface]
DESCRIPTION
mopd services MOP Load requests on the Ethernet connected to interface or all interfaces if '-a' is given. In a load request received by
mopd a filename can be given. This is the normal case for e.g. terminal servers. If a filename isn't given mopd must know what image to
load.
Upon receiving a request, mopd checks if the requested file exists in /srv/tftp/mop, the filename is normally uppercase and with an extension
of .SYS. If the filename isn't given, the ethernet address (in lower case, apart from the .SYS) of the target is used as the filename, e.g.
08002b09f4de.SYS and it might be a soft link to another file.
mopd supports two kinds of files. The first type that is check is if the file is in a.out(5) format. If not, a couple of Digital's formats
are checked.
In normal operation, mopd forks a copy of itself and runs in the background. Anomalies and errors are reported via syslog(3).
OPTIONS -a Listen on all the Ethernets attached to the system. If '-a' is omitted, an interface must be specified.
-d Run in debug mode, with all the output to stdout. The process will run in the foreground.
-f Run in the foreground.
FILES
/srv/tftp/mop
SEE ALSO bpf(4), mopa.out(1), mopchk(1), mopprobe(1), moptrace(1)
DECnet Digital Network Architecture Phase IV, Maintenance Operations Functional Specification V3.0.0, AA-X436A-TK.
DECnet Digital Network Architecture, Maintenance Operations Protocol Functional Specification V4.0.0, EK-DNA11-FS-001.
AUTHORS
Mats O Jansson (moj@stacken.kth.se).
September 24, 1995