Sponsored Content
Top Forums Shell Programming and Scripting compare 2 files based on columns Post 302489623 by Scrutinizer on Friday 21st of January 2011 02:45:45 AM
Old 01-21-2011
If you do
Code:
ls -l *.nomatch

You should see files that contain the non-matchess... If the files are called f2 and f1 then you should see f1.nomatch and f2.nomatch
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare few columns from two files

My Friends, Need your help to find the difference between few columns from two comma delimited files. For example, File1 and File2 has 22 columns, and I want to find the difference in first 12 columns. I have list of file names in MyListOfFiles2Compare.txt. Data is separated with commas.... (5 Replies)
Discussion started by: manish44
5 Replies

2. Shell Programming and Scripting

How to compare two columns in two files?

Hello all, Could someone please let me know shell script or awk solution to compare two columns in two files? Here is the sample - file1.txt abc/xyz,M1234 ddd/lyg,M2345 cnn/tnt,G0123 file2.txt A,abc/xyz,kk,dd,zz,DCT,G0123,1 A,ddd/lyg,kk,dd,zz,DCT,M1234,1... (17 Replies)
Discussion started by: sncoupons
17 Replies

3. Shell Programming and Scripting

How to compare 2 files & get only few columns based on a condition related to both files?

Hiiiii friends I have 2 files which contains huge data & few lines of it are as shown below File1: b.dat(which has 21 columns) SSR 1976 8 12 13 10 44.00 39.0700 70.7800 7.0 0 0.00 0 2.78 0.00 0.00 0 0.00 2.78 0 NULL ISC 1976 8 12 22 32 37.39 36.2942 70.7338... (6 Replies)
Discussion started by: reva
6 Replies

4. Shell Programming and Scripting

Compare columns of 2 files based on condition defined in a different file

I have a control file which tells me which are the fields in the files I need to compare and based on the values I need to print the exact value if key =Y and output is Y , or if output is Y/N then I need to print only Y if it matches or N if it does not match and if output =N , then skip the feild... (7 Replies)
Discussion started by: newtoawk
7 Replies

5. UNIX for Dummies Questions & Answers

Compare Columns in two files

Hi all, I would like to compare a column in one file to a column in another file and when there is a match it prints the first column and the corresponding second column. Example File1 ABA ABC ABE ABF File 2 ABA 123 ABB 124 ABD 125 ABC 126 So what I would like printed to a file... (0 Replies)
Discussion started by: pcg
0 Replies

6. Shell Programming and Scripting

Compare Columns of two files

Hi I have file 1 like this and file 2 like this I need to compare column 3 of both files and delete lines in file1 with same column 3 values in two files. So the output is I tried with perl but didnt work. A perl code will be good as I am learning the language, but any other code would... (1 Reply)
Discussion started by: polsum
1 Replies

7. Shell Programming and Scripting

Compare columns in different files

Hi, I have two files like this: 8 1.3 10 1.3 12 1.3 15 1.3 21 1.3 and 1 2 3 4 10 11 15 16 21 22 (3 Replies)
Discussion started by: jamie_123
3 Replies

8. Shell Programming and Scripting

Compare 2 csv files by columns, then extract certain columns of matcing rows

Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns. I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies

9. UNIX for Dummies Questions & Answers

Help need to compare columns in files

Hi, Below is my requirement file1 id|cnt 1|1 2|2 3|3 file2 id_1|cnt_1 1|1 2|1 3|1 I want to compare cnt and cnt_1 columns, if they are differ then give the details Am using below awk command, but the output is not as expected. (2 Replies)
Discussion started by: grandhirahuletl
2 Replies

10. UNIX for Dummies Questions & Answers

How to compare two columns in two files?

Hi All, I have a.dat file with content 1,338,30253395122015103,2015103,UB0085000,STMT151117055527002,,, 1,338,30253395122015103,2015103,UB0085000,STMT151117055527001,,, and b.dat having content 1,STMT151117055527001,a1.txt,b1.txt,c1.txt 1,STMT151117055527002,a2.txt,b2.txt,c2.txt ... (13 Replies)
Discussion started by: PRAMOD 96
13 Replies
NG_ETF(4)                                                  BSD Kernel Interfaces Manual                                                  NG_ETF(4)

NAME
ng_etf -- Ethertype filtering netgraph node type SYNOPSIS
#include <netgraph.h> #include <netgraph/ng_etf.h> DESCRIPTION
The etf node type multiplexes and filters data between hooks on the basis of the ethertype found in an Ethernet header, presumed to be in the first 14 bytes of the data. Incoming Ethernet frames are accepted on the downstream hook and if the ethertype matches a value which the node has been configured to filter, the packet is forwarded out the hook which was identified at the time that value was configured. If it does not match a configured value, it is passed to the nomatch hook. If the nomatch hook is not connected, the packet is dropped. Packets travelling in the other direction (towards the downstream hook) are also examined and filtered. If a packet has an ethertype that matches one of the values configured into the node, it must have arrived in on the hook for which that value was configured, otherwise it will be discarded. Ethertypes of values other than those configured by the control messages must have arrived via the nomatch hook. HOOKS
This node type supports the following hooks: downstream Typically this hook would be connected to a ng_ether(4) node, using the lower hook. nomatch Typically this hook would also be connected to an ng_ether(4) type node using the upper hook. <any legal name> Any other hook name will be accepted and can be used as the match target of an ethertype. Typically this hook would be attached to a protocol handling node that requires and generates packets with a particular set of ethertypes. CONTROL MESSAGES
This node type supports the generic control messages, plus the following: NGM_ETF_GET_STATUS This command returns a struct ng_etfstat containing node statistics for packet counts. NGM_ETF_SET_FILTER Sets the a new ethertype filter into the node and specifies the hook to and from which packets of that type should use. The hook and ethertype are specified in a structure of type struct ng_etffilter: struct ng_etffilter { char matchhook[NG_HOOKSIZ]; /* hook name */ u_int16_t ethertype; /* catch these */ }; EXAMPLES
Using ngctl(8) it is possible to set a filter in place from the command line as follows: #!/bin/sh ETHER_IF=fxp0 MATCH1=0x834 MATCH2=0x835 cat <<DONE >/tmp/xwert # Make a new ethertype filter and attach to the Ethernet lower hook. # first remove left over bits from last time. shutdown ${ETHER_IF}:lower mkpeer ${ETHER_IF}: etf lower downstream # Give it a name to easily refer to it. name ${ETHER_IF}:lower etf # Connect the nomatch hook to the upper part of the same interface. # All unmatched packets will act as if the filter is not present. connect ${ETHER_IF}: etf: upper nomatch DONE ngctl -f /tmp/xwert # something to set a hook to catch packets and show them. echo "Unrecognised packets:" nghook -a etf: newproto & # Filter two random ethertypes to that hook. ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH1} } ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH2} } DONE SHUTDOWN
This node shuts down upon receipt of a NGM_SHUTDOWN control message, or when all hooks have been disconnected. SEE ALSO
netgraph(4), ng_ether(4), ngctl(8), nghook(8) HISTORY
The ng_etf node type was implemented in FreeBSD 5.0. AUTHORS
Julian Elischer <julian@FreeBSD.org> BSD May 16, 2006 BSD
All times are GMT -4. The time now is 01:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy