07-28-2012
Kindly check:remove duplicates with similar data in front of it
Hi all,
I have 2 files containing data like this:
Quote:
1 x
1 x
2 y
2 z
3 s
3 s
3 s
4 g
4 h
5 i
6 k
7 y
Quote:
1 x y z
1 x y z
2 y h f
2 z s k
3 s
3 s
3 s
4 g
4 h
5 i
6 k
7 y
so if there is same entry repeated in the column like1,2,3,4
I have to check if there is different entries column like 2,4
but similar entries for duplicatein column 2 like1,3
the output shuld be like this for first file
Quote:
1 x
2 y,z
3 s
4 g,h
5 i
6 k
7 y
Please let me know scripting regarding this.
In the same way for second file as well if data in colmn 2 is diferent print for duplicate entries arranged it like this
Last edited by manigrover; 07-28-2012 at 04:52 AM..
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a txt file called a.txt which contain over 10,000 records and I would like to remove space before comma or after comma....like below:
The input (for example two record 00001,00002):
00001,client,card limited ,02292,N ,162:41 , 192, ... (6 Replies)
Discussion started by: happyv
6 Replies
2. Shell Programming and Scripting
dear pro-coders,
is there any command out there that takes out the front spaces from a string?
sample strings:
4 members
5 members
3 members
but it has to be like so:
4 members
5 members
3 members (3 Replies)
Discussion started by: pseudocoder
3 Replies
3. Shell Programming and Scripting
Hi all
I have a file with following kind of data
I want to remove duplicates according to first column so that output contains
Kindly let me scripting regading this. (4 Replies)
Discussion started by: manigrover
4 Replies
4. Shell Programming and Scripting
Hi alll
I have a file with following kind input
I want in output duplicates should not be there but there should be numbering mentioned before that like (4 Replies)
Discussion started by: manigrover
4 Replies
5. Shell Programming and Scripting
Hi all
I have a file with following input
It contains 5 columns
gene name drug drug ID disease approved
Now the same gene is repeated many times with different data in column2,3 ,4,5
I want to arrange dat in such a way that there shuld be one entry in the column(no... (2 Replies)
Discussion started by: manigrover
2 Replies
6. Shell Programming and Scripting
Hi all,
I have an input file like this
Now
I have to remove duplicates only in first column and nothing has to be changed in second and third column. so that output would be
Please let me know scripting regarding this (20 Replies)
Discussion started by: manigrover
20 Replies
7. Shell Programming and Scripting
Hi all,
I have 2 files in which i have to find commom entries in column 1 an dif soemthing is common write other data of both files in front of it mentioned.
Gene symbol and disease name
column 1 column2
ARFGEF2 CAD
DDEF2 CAD
PSCD3 CAD
PSCD4 CAD
CAMK1... (15 Replies)
Discussion started by: manigrover
15 Replies
8. Shell Programming and Scripting
Hi all,
I have 3 files with such data
first files
second file
third file
I have to find common entries of first column in two ways
1) between 2 files (2 Replies)
Discussion started by: manigrover
2 Replies
9. Shell Programming and Scripting
Hi ,
I have below data inside a file named ref.psv . I want to create a shell script which will do the below 2 points :
(1) sort the file content first based on the latest date which is the last column in the file (actual file its the 175th column)
(2)after sorting the file based on latest date... (3 Replies)
Discussion started by: samrat dutta
3 Replies
LEARN ABOUT SUNOS
ppmtopgm
ppmtopgm(1) General Commands Manual ppmtopgm(1)
NAME
ppmtopgm - convert a portable pixmap into a portable graymap
SYNOPSIS
ppmtopgm [ppmfile]
DESCRIPTION
Reads a portable pixmap as input. Produces a portable graymap as output. The output is a "black and white" rendering of the original
image, as in a black and white photograph. The quantization formula used is .299 r + .587 g + .114 b.
Note that although there is a pgmtoppm program, it is not necessary for simple conversions from pgm to ppm , because any ppm program can
read pgm (and pbm ) files automatically. pgmtoppm is for colorizing a pgm file. Also, see ppmtorgb3 for a different way of converting
color to gray. And ppmdist generates a grayscale image from a color image, but in a way that makes it easy to differentiate the original
colors, not necessarily a way that looks like a black and white photograph.
QUOTE
Cold-hearted orb that rules the night
Removes the colors from our sight
Red is gray, and yellow white
But we decide which is right
And which is a quantization error.
SEE ALSO
pgmtoppm(1),ppmtorgb3(1),rgb3toppm(1),ppmdist(1),ppm(5),pgm(5)
AUTHOR
Copyright (C) 1989 by Jef Poskanzer.
10 April 2000 ppmtopgm(1)