Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to remove duplicated based on longest row & largest value in a column Post 302352576 by sanjay.login on Saturday 12th of September 2009 03:28:23 AM
Old 09-12-2009
Hi Reva,
you can use the follwoing code: Hope it will work fine for you.

sort -k 2,4 -k 19r|awk 'a!=$2$3$4 {a=$2$3$4;print $0}'

I got the out put as:


SIG 2007 3 24 4 35 45.80 5.2600 94.3100 58 0 5.20 0 0.00 5.00 0.00 0 0.00 5.20 0
SEG 2008 3 25 18 27 35.06 1.7700 99.3400 89 0 5.00 0 0.00 0.00 0.00 0 0.00 5.00 0
PDE-Q 2009 7 2 23 50 49.20 37.4800 71.7400 108 0 4.70 0 0.00 0.00 0.00 0 0.00 4.70 0 tttt
PDE-Q 2009 7 3 4 42 32.83 34.4600 24.1200 41 0 4.50 0 0.00 0.00 0.00 0 0.00 4.50 0 yyy
PDE-Q 2009 7 5 9 45 48.77 36.4600 71.0700 248 0 4.90 0 0.00 0.00 0.00 0 0.00 4.90 0
PDE-Q 2009 7 6 16 0 38.96 3.0400 93.3500 34 0 4.90 0 0.00 0.00 0.00 0 0.00 4.90 0
PDE-Q 2009 7 7 1 2 0.48 34.1600 25.5100 25 0 4.80 0 0.00 0.00 0.00 0 3.00 4.80 0
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ITERATION: remove row based on string value

It is my first post, hoping to get help from the forum. In a directory, I have 5000 multiple files that contains around 4000 rows with 10 columns in each file containing a unique string 'AT' located at 4th column. OM 3328 O BT 268 5.800 7.500 4.700 0.000 ... (9 Replies)
Discussion started by: asanjuan
9 Replies

2. Shell Programming and Scripting

How to print column based on row number

Hi, I want to print column value based on row number say multiple of 8. Input file: line 1 67 34 line 2 45 57 . . . . . . line 8 12 46 . . . . . . line 16 24 90 . . . . . . line 24 49 67 Output 46 90 67 (2 Replies)
Discussion started by: Surabhi_so_mh
2 Replies

3. Shell Programming and Scripting

duplicate row based on single column

I am a newbie to shell scripting .. I have a .csv file. It has 1000 some rows and about 7 columns... but before I insert this data to a table I have to parse it and clean it ..basing on the value of the first column..which a string of phone number type... example below.. column 1 ... (2 Replies)
Discussion started by: mitr
2 Replies

4. Shell Programming and Scripting

need to remove duplicates based on key in first column and pattern in last column

Given a file such as this I need to remove the duplicates. 00060011 PAUL BOWSTEIN ad_waq3_921_20100826_010517.txt 00060011 PAUL BOWSTEIN ad_waq3_921_20100827_010528.txt 0624-01 RUT CORPORATION ad_sade3_10_20100827_010528.txt 0624-01 RUT CORPORATION ... (13 Replies)
Discussion started by: script_op2a
13 Replies

5. Shell Programming and Scripting

Sort a the file & refine data column & row format

cat file1.txt field1 "user1": field2:"data-cde" field3:"data-pqr" field4:"data-mno" field1 "user1": field2:"data-dcb" field3:"data-mxz" field4:"data-zul" field1 "user2": field2:"data-cqz" field3:"data-xoq" field4:"data-pos" Now i need to have the date like below. i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies

6. Shell Programming and Scripting

Deleting a row based on fetched value of column

Hi, I have a file which consists of two columns but the first one can be varying in length like 123456789 0abcd 123456789 0abcd 4015 0 0abcd 5000 0abcd I want to go through the file reading each line, count the number of characters in the first column and delete... (2 Replies)
Discussion started by: swasid
2 Replies

7. Shell Programming and Scripting

Remove duplicates within row and separate column

Hi all I have following kind of input file ESR1 PA156 leflunomide PA450192 leflunomide CHST3 PA26503 docetaxel Pa4586; thalidomide Pa34958; decetaxel docetaxel docetaxel I want to remove duplicates and I want to separate anything before and after PAxxxx entry into columns or... (1 Reply)
Discussion started by: manigrover
1 Replies

8. Shell Programming and Scripting

Find smallest & largest in every column

Dear All, I have input like this, J_15TEST_ASH05_33A22.13885.txt: $$ 1 MAKE SP1501 1 1 4 6101 7392 2 2442 2685 18 3201 4008 20 120 4158 J_15TEST_ASH05_33A22.13885.txt: $$ 1 MAKE SP1502 1 1 4 5125 6416 2 ... (4 Replies)
Discussion started by: attila
4 Replies

9. Shell Programming and Scripting

Trying to remove duplicates based on field and row

I am trying to see if I can use awk to remove duplicates from a file. This is the file: -==> Listvol <== deleting /vol/eng_rmd_0941 deleting /vol/eng_rmd_0943 deleting /vol/eng_rmd_0943 deleting /vol/eng_rmd_1006 deleting /vol/eng_rmd_1012 rearrange /vol/eng_rmd_0943 ... (6 Replies)
Discussion started by: newbie2010
6 Replies

10. Shell Programming and Scripting

How to remove duplicated column in a text file?

Dear all, How can I remove duplicated column in a text file? Input: LG10_PM_map_19_LEnd 1000560 G AA AA AA AA AA GG LG10_PM_map_19_LEnd 1005621 G GG GG GG AA AA GG LG10_PM_map_19_LEnd 1011214 A AA AA AA AA GG GG LG10_PM_map_19_LEnd 1011673 T TT TT TT TT CC CC... (1 Reply)
Discussion started by: huiyee1
1 Replies
CPG_ZCB_ALLOC(2009-04-15)												 CPG_ZCB_ALLOC(2009-04-15)

NAME
cpg_zcb_alloc - Allocates a zero copy buffer #include <corosync/cpg.h> int cpg_zcb_alloc(cpg_handle_t handle, size_t size, void **buffer); DESCRIPTION
The cpg_zcb_alloc function will allocate a zero copy buffer for use with the cpg_zcb_mcast_joined(3) funtion. This buffer should not be used in another thread while a cpg_zcb_mcast_joined operation is taking place on the buffer. The buffer is allocated via operating system mechanisms to avoid copying in the IPC layer. The argument handle describes the handle on which the buffer will be allocated. The argument size requests a buffer of size be allocated. The buffer argument is set to the buffer address that is allocated by this operatoin. RETURN VALUE
This call returns the CPG_OK value if successful, otherwise an error is returned. ERRORS
The errors are undocumented. SEE ALSO
cpg_overview(8), cpg_initialize(3), cpg_finalize(3), cpg_fd_get(3), cpg_dispatch(3), cpg_join(3), cpg_leave(3), cpg_mcast_joined(3), cpg_membership_get(3) cpg_zcb_alloc(3) cpg_zcb_free(3) cpg_zcb_mcast_joined(3) cpg_context_get(3) cpg_context_set(3) cpg_local_get(3) Corosync Cluster Engine Programmer's Manual corosync Man Page CPG_ZCB_ALLOC(2009-04-15)
All times are GMT -4. The time now is 07:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy