Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to count the frequncey of a certain value in one column? Post 302734279 by luoruicd on Wednesday 21st of November 2012 07:11:36 PM
Old 11-21-2012
How to count the frequncey of a certain value in one column?

Hi all,
I have file like this:
FID IID MISS_PHENO N_MISS N_GENO F_MISS
AU4103 AU4103201 Y 15473 66858 0.2314
AU4142 AU4142303 Y 15464 66858 0.2313
AU4128 AU4128304 Y 15458 66858 0.2312
AU4129 AU4129202 Y 15451 66858 0.2311
AU3934 AU3934201 Y 15441 66858 0.231
AU3934 AU3934304 Y 15448 66858 0.2311
AU3934 AU3934302 Y 15466 66858 0.2313
AU3934 AU3934202 Y 15483 66858 0.2316
AU4012 AU4012201 Y 15460 66858 0.2312

In column 3, I have both "Y" and "N", how can I count how many "Y" and "N" are in this column?

thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get the count only if two column matches?

Hi, I have a file with the contents as below, 10:23:10 GOOD 10.30.50.60 10:23:11 GOOD 10.30.50.62 10:23:12 Hello 10.30.50.60 10:23:12 BAD 10.30.50.60 10:23:13 GOOD 10.30.50.66 10:23:14 BAD 10.30.50.62... (3 Replies)
Discussion started by: gobinath
3 Replies

2. UNIX for Advanced & Expert Users

column count

I am making a script in bash shell and need to find out how many columns are in each row. I tried using awk '{print NF}' which will give me the number of columns for each row of the file all at once which is not what i want. I am trying to read each line individual from a file and want to know... (6 Replies)
Discussion started by: HackerSeabass
6 Replies

3. Shell Programming and Scripting

Column value and it's count

Hi, i have data like a b a a b c d ... I have to output info of each distinct value that appears in the column and the count of it a-3,b-2,c-1,d-1 Is there a single line command using awk or sed to accomplish this? Thanks, -srinivas yelamanchili (7 Replies)
Discussion started by: ysrini
7 Replies

4. Shell Programming and Scripting

Count column data

Hi Guys, B07 U51C A1 44 B1 44 Yes B07 L64U A2 44 B1 44 Yes B07 L62U A2 44 B1 44 Yes B07 L11C A4 32 B1 44 NO B05 L12Z A1 12 B1 44 NO B01 651Z A2 44 B1 44 NO B04 A51Z A2 12 B1 44 NO L07 B08D A4 12 B1 44 NO B07 RU8D A4 44 B1 44 Yes B07 L58D A4 15 B1 44 No B07 LA8D A4 44 B1 44 Yes B07... (6 Replies)
Discussion started by: asavaliya
6 Replies

5. Shell Programming and Scripting

Need Count of Column

Need help on count AL06 AL06_71 A=1 it=1 90 AL06 AL06_72 A=1 it=1 60 AL06 AL06_73 A=1 it=1 80 AL06 AL06_7 A=2 it=1 0 AL06 AL06_7 A=2 it=1 0 AL06 AL06_7 A=2 it=1 0 AL07 AL07_71 A=1 it=1 40 AL07 AL07_72 A=1 it=1 40 AL07 AL07_73 A=1 it=1 70 AL08 AL08_7 A=2 it=1 0 1 AL08 AL08_7 A=2 it=1... (2 Replies)
Discussion started by: asavaliya
2 Replies

6. Shell Programming and Scripting

Count Column and Print at last

HI Guys, Count base on column A Input:- U00393 6 000100000 U00393 7 000100001 U00393 8 000100002 U00393 9 000100003 U00393 10 000100004 U00393 11 000100005 U00928 6 000100000 U00928 7 000100001 U00964 6 000100000 U00964 7 000100001 U00964 8 000100002 U00972 6 000100000 U00972... (3 Replies)
Discussion started by: asavaliya
3 Replies

7. UNIX for Dummies Questions & Answers

Count column

how do i count column in a file. test1,test2,test3,,, = 5 columns (6 Replies)
Discussion started by: lawsongeek
6 Replies

8. Shell Programming and Scripting

Uniq count second column

Hello How can I get a number of occurrence count for this file; ERR315389.1000156 CTTGAAGAAGAATTGAAAACTGTGACGAACAACTTGAAGTCACTGGAGGCTCAGGCTGAGAAGTACTCGCAGAAGGAAGACAGATATGAGGAAGAG ERR315389.1000281 ... (3 Replies)
Discussion started by: Wan Fahmi
3 Replies

9. Shell Programming and Scripting

Read first column and count lines in second column using awk

Hello all, I would like to ask your help here: I've a huge file that has 2 columns. A part of it is: sorted.txt: kss23 rml.67lkj kss23 zhh.6gf kss23 nhd.09.fdd kss23 hp.767.88.89 fl67 nmdsfs.56.df.67 fl67 kk.fgf.98.56.n fl67 bgdgdfg.hjj.879.d fl66 kl..hfh.76.ghg fl66... (5 Replies)
Discussion started by: Padavan
5 Replies

10. Shell Programming and Scripting

Column 2 string count in Column 3

My I/p is Col1|Col2|Col3 2116209997932|POSIX INC|POSIX 2116209997933|POSIX INC|POSIX 2116210089479|POSIX INC|POSIX 2116210180502|POSIX INC|POSIX 2116210512279|POSIX INC|Aero 2116210516838|POSIX INC|POSIX 2116210534342|POSIX INC|postal 2116210534345|POSIX INC|postal ... (6 Replies)
Discussion started by: nikhil jain
6 Replies
Info::Layer3::BayRS(3pm)				User Contributed Perl Documentation				  Info::Layer3::BayRS(3pm)

NAME
SNMP::Info::Layer3::BayRS - SNMP Interface to Nortel routers running BayRS. AUTHOR
Eric Miller SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. my $bayrs = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost. "; my $class = $bayrs->class(); print "SNMP::Info determined this device to fall under subclass : $class "; DESCRIPTION
Abstraction subclass for routers running Nortel BayRS. For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above. my $bayrs = new SNMP::Info::Layer3::BayRS(...); Inherited Classes SNMP::Info SNMP::Info::Bridge SNMP::Info::Layer3 Required MIBs Wellfleet-HARDWARE-MIB Wellfleet-MODULE-MIB Wellfleet-OSPF-MIB Wellfleet-DOT1QTAG-CONFIG-MIB Wellfleet-CSMACD-MIB Inherited MIBs See "Required MIBs" in SNMP::Info for its own MIB requirements. See "Required MIBs" in SNMP::Info::Bridge for its own MIB requirements. See "Required MIBs" in SNMP::Info::Layer3 for its own MIB requirements. GLOBALS
These are methods that return scalar value from SNMP $bayrs->model() Returns the model of the BayRS router. Will translate between the MIB model and the common model with this map : C<%MODEL_MAP = ( 'acefn' => 'FN', 'aceln' => 'LN', 'acecn' => 'CN', 'afn' => 'AFN', 'in' => 'IN', 'an' => 'AN', 'arn' => 'ARN', 'sys5000' => '5000', 'freln' => 'BLN', 'frecn' => 'BCN', 'frerbln' => 'BLN-2', 'asn' => 'ASN', 'asnzcable' => 'ASN-Z', 'asnbcable' => 'ASN-B', );> $bayrs->vendor() Returns 'nortel' $bayrs->os() Returns 'bayrs' $bayrs->os_ver() Returns the software version extracted from "sysDescr" $bayrs->serial() Returns ("wfHwBpSerialNumber") after conversion to ASCII decimal $bayrs->root_ip() Returns the primary IP used to communicate with the router. Returns the first found: CLIP (CircuitLess IP), ("wfOspfRouterId"), or undefined. Globals imported from SNMP::Info See documentation in "GLOBALS" in SNMP::Info for details. Globals imported from SNMP::Info::Bridge See documentation in "GLOBALS" in SNMP::Info::Bridge for details. Globals imported from SNMP::Info::Layer3 See documentation in "GLOBALS" in SNMP::Info::Layer3 for details. TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash. Note: These methods do not support partial table fetches, a partial can be passed but the entire table will be returned. Overrides $bayrs->interfaces() Returns reference to the map between IID and physical Port. The physical port name is stripped to letter and numbers to signify port type and slot port (S11) if the default platform naming was maintained. Otherwise the port is the interface description. $bayrs->i_name() Returns ("ifDescr") along with VLAN name ("wfDot1qTagCfgVlanName") for VLAN interfaces. $bayrs->i_duplex() Returns reference to hash. Maps port operational duplexes to IIDs for Ethernet interfaces. $bayrs->i_duplex_admin() Returns reference to hash. Maps port admin duplexes to IIDs for Ethernet interfaces. $bayrs->i_vlan() Returns reference to hash. Maps port VLAN ID to IIDs. Pseudo ENTITY-MIB information These methods emulate ENTITY-MIB Physical Table methods using Wellfleet-HARDWARE-MIB and Wellfleet-MODULE-MIB. $bayrs->e_index() Returns reference to hash. Key and Value: Integer. The index is created by combining the slot, module, and position into a five or six digit integer. Slot can be either one or two digits while the module and position are each two digits padded with leading zero if required. $bayrs->e_class() Returns reference to hash. Key: IID, Value: General hardware type. This class only returns container and module types. $bayrs->e_descr() Returns reference to hash. Key: IID, Value: Human friendly name. $bayrs->e_name() Returns reference to hash. Key: IID, Value: Human friendly name. $bayrs->e_hwver() Returns reference to hash. Key: IID, Value: Hardware version. $bayrs->e_vendor() Returns reference to hash. Key: IID, Value: nortel. $bayrs->e_serial() Returns reference to hash. Key: IID, Value: Serial number. $bayrs->e_pos() Returns reference to hash. Key: IID, Value: The relative position among all entities sharing the same parent. $bayrs->e_type() Returns reference to hash. Key: IID, Value: Type of component/sub-component as defined in Wellfleet-HARDWARE-MIB for processors and link modules or Wellfleet-MODULE-MIB for hardware modules. $bayrs->e_fwver() Returns reference to hash. Key: IID, Value: Firmware revision. Only available on processors. $bayrs->e_swver() Returns reference to hash. Key: IID, Value: Software revision. Only available on processors. $bayrs->e_parent() Returns reference to hash. Key: IID, Value: The value of e_index() for the entity which 'contains' this entity. A value of zero indicates this entity is not contained in any other entity. Table Methods imported from SNMP::Info See documentation in "TABLE METHODS" in SNMP::Info for details. Table Methods imported from SNMP::Info::Bridge See documentation in "TABLE METHODS" in SNMP::Info::Bridge for details. Table Methods imported from SNMP::Info::Layer3 See documentation in "TABLE METHODS" in SNMP::Info::Layer3 for details. Data Munging Callback Subroutines $extreme->munge_hw_rev() Converts octets to a decimal major.minor string. $extreme->munge_wf_serial() Coverts octets to a decimal string. perl v5.12.4 2011-09-28 Info::Layer3::BayRS(3pm)
All times are GMT -4. The time now is 11:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy