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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT OPENSOLARIS
ng_etf
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