Sponsored Content
Top Forums Shell Programming and Scripting Column 2 string count in Column 3 Post 302975538 by nikhil jain on Wednesday 15th of June 2016 04:51:13 AM
Old 06-15-2016
Column 2 string count in Column 3

My I/p is

Code:
Code:
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 
2116210545347|POSIX INC|Aero 
2116210556200|POSIX INC|POSIX 
2116210560525|POSIX INC|Aero 
212230510298|POSIX INC|postal
212230582802|POSIX INC|POSIX 
212230582803|POSIX INC|POSIX

Required o/p, I want the number of counts the 3rd column is come as shown below

Code:
Code:
Col1|Col2|Col3
POSIX INC|POSIX|8
POSIX INC|Aero|3
POSIX INC|postal|3

If 3rd Column i s blank, It should consider even that and give the count as shown

Last edited by nikhil jain; 06-15-2016 at 06:02 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

2. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

3. Shell Programming and Scripting

Copy column string and put in different column

Hello Here is my input: SU3902 SU3902A NS29C (10) (00) Q1J1 0 SU3902 SU3902B VLR05 (20) (02) Q2H1 4 SU3902 SU3902C NBR22 (30) (06) Q3R5 8 SU3904 SU39047 NSV19 (11) (09) Q4k6 2 SU3904 SU39048 LB231 (12) (05) Q5k1 6 SU3904 SU39049 11VLT (13) (08) Q10C1 10 SU3904 SU3904A 25R05 (15) (06)... (3 Replies)
Discussion started by: pareshkp
3 Replies

4. 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

5. Shell Programming and Scripting

Use a string in one column to get the largest or the smallest of another column

I have data that looks like this: chr1 mm9_knownGene exon 155747075 155747189 0.000000 + . gene_id "Glul"; transcript_id "uc007daq.1"; chr1 mm9_knownGene exon 155750064 155750076 0.000000 + . gene_id "Glul";... (3 Replies)
Discussion started by: pbluescript
3 Replies

6. Shell Programming and Scripting

Difference of the same column when two other column matches and one column differs less than 1 hour

This is my input file : # cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9 This is the required output ... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies

7. Shell Programming and Scripting

Count occurrence of string in a column using awk

Hi, I want to count the occurrences of strings in a column and display as in example below: Input: get1 345 789 098 get2 567 982 090 fet4 777 610 632 get1 800 544 230 get1 600 788 451 get2 892 321 243 get1 673 111 235 fet3 789 220 278 fet4 768 222 341 output: 4 get1 345 789... (7 Replies)
Discussion started by: aydj
7 Replies

8. UNIX for Dummies Questions & Answers

Count occurrence of string (based on type) in a column using awk

Hello, I have a table that looks like what is shown below: AA BB CC XY PQ RS AA BB CC XY RS I would like the total counts depending on the set they belong to: if search pattern is in {AA, BB, CC} --> count them as Type1 | wc -l (3 Replies)
Discussion started by: Gussifinknottle
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

Count occurrence of column one unique value having unique second column value

Hello Team, I need your help on the following: My input file a.txt is as below: 3330690|373846|108471 3330690|373846|108471 0640829|459725|100001 0640829|459725|100001 3330690|373847|108471 Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies
ACL_FREE(3)						   BSD Library Functions Manual 					       ACL_FREE(3)

NAME
acl_free -- free ACL working state LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <sys/acl.h> int acl_free(void *obj_p); DESCRIPTION
The acl_free() call allows the freeing of ACL working space, such as is allocated by acl_dup(3), or acl_from_text(3). IMPLEMENTATION NOTES
FreeBSD's support for POSIX.1e interfaces and features is still under development at this time. RETURN VALUES
The acl_free() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indi- cate the error. ERRORS
If any of the following conditions occur, the acl_free() function shall return -1 and set errno to the corresponding value: [EINVAL] The value of the obj_p argument is invalid. SEE ALSO
acl(3), acl_dup(3), acl_from_text(3), acl_get(3), acl_init(3), posix1e(3) STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17. Discussion of the draft continues on the cross-platform POSIX.1e implementation mailing list. To join this list, see the FreeBSD POSIX.1e implementation page for more information. HISTORY
POSIX.1e support was introduced in FreeBSD 4.0, and development continues. AUTHORS
Robert N M Watson BSD
January 28, 2000 BSD
All times are GMT -4. The time now is 08:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy