Sponsored Content
Top Forums Shell Programming and Scripting Filtering rows for first two instances of a value Post 302417446 by genehunter on Friday 30th of April 2010 01:41:36 AM
Old 04-30-2010
Posted the Output required.
If the Col3 occurs only once in some cases and then, it should also be written to the output. However, when Col3 value occurs more than once
like..
Code:
 CHR_A	BP_A	SNP_A	CHR_B	BP_B	SNP_B	R2	p-SNP_A	p-SNP_B
4	172575323	rs17056855	4	172601079	rs11945883	0.119414	0.049972656	0.031050345
4	172575323	rs17056855	4	172603701	rs7662060	0.11978	0.049972656	0.034664046
4	172575323	rs17056855	4	172604186	rs17056919	0.382896	0.049972656	0.037136752
4	172575323	rs17056855	4	172604350	rs4692884	0.11925	0.049972656	0.034632158
4	172575323	rs17056855	4	172605017	rs17056925	0.373343	0.049972656	0.037902134

It should write only the first two instances sorted on the columns p-SNP_A and p-SNP_B in that order.

Code:
CHR_A	BP_A	SNP_A	CHR_B	BP_B	SNP_B	R2	p-SNP_A	p-SNP_B
4	172575323	rs17056855	4	172601079	rs11945883	0.119414	0.049972656	0.031050345
4	172575323	rs17056855	4	172604350	rs4692884	0.11925	0.049972656	0.034632158

Also, can you explain how to sort a column with a mixture of values in decimals and scientific format (1E-06)?
Thanks
~GH

---------- Post updated 04-30-10 at 01:41 AM ---------- Previous update was 04-29-10 at 03:55 PM ----------

Please help!
vgersh my savior!!
Thanks
~GH
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

multiple instances of syslogd - is it possible?

I would like to start up multiple instances of syslog daemon. I am having a little difficulty. Is this at all possible? I have separate syslog.conf1.... syslog.conf5 files. I have linked the daemon to separate files syslogd1 ... syslogd5 I have arranged the rcd.2 start/stop scripts for... (9 Replies)
Discussion started by: Gary Dunn
9 Replies

2. Shell Programming and Scripting

Command filtering ONLY rows NOT beginning with '*'

I need a command which filters rows ONLY NOT beginning with '*' So far I have following NOT sufficient command, because it does not include ALL possible literals except of '*' grep ^ INPUT_FILE >>OUTPUT_FILE Is it possible to write something like grep NOT ^ INPUT_FILE... (3 Replies)
Discussion started by: ABE2202
3 Replies

3. Shell Programming and Scripting

Deleting specific rows in large files having rows greater than 100000

Hi Guys, I need help in modifying a large text file containing more than 1-2 lakh rows of data using unix commands. I am quite new to the unix language the text file contains data in a pipe delimited format sdfsdfs sdfsdfsd START_ROW sdfsd|sdfsdfsd|sdfsdfasdf|sdfsadf|sdfasdf... (9 Replies)
Discussion started by: manish2009
9 Replies

4. Shell Programming and Scripting

Split single rows to multiple rows ..

Hi pls help me out to short out this problem rm PAB113_011.out rm: PAB113_011.out: override protection 644 (yes/no)? n If i give y it remove the file. But i added the rm command as a part of ksh file and i tried to remove the file. Its not removing and the the file prompting as... (7 Replies)
Discussion started by: sri_aue
7 Replies

5. Shell Programming and Scripting

filtering the rows in a file

hi all, please help on this isssue, i have a file which contains something like this and i want to seprate the servers which has vasd.pid ,i need only server names. i want output something like this which vasd.pid . server1 server3 server4 (4 Replies)
Discussion started by: sudharson
4 Replies

6. Programming

Multiple instances of pthread

Suppose I declare pthread_t clear_thread; and then pthread_create(&clear_thread, &detach, clear_message, this); the thread is supposed to go away, perform the service it is intended to procide, and then kill itself. A little while later, I require this service again, so I say ... (2 Replies)
Discussion started by: clerew
2 Replies

7. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

8. Shell Programming and Scripting

Replace other instances except the first one

Hi Friends, This is my input track type=alpha name="omega" fixedStep chrom=chr10 name="omega" 1 2 3 34 4 4 44 4 4 34 5 5 566 6 (1 Reply)
Discussion started by: jacobs.smith
1 Replies

9. Shell Programming and Scripting

Filtering out rows

# powermt display dev=all .... snipped ... Pseudo name=hdiskpower8 Symmetrix ID=000192602584 Logical device ID=059F state=alive; policy=SymmOpt; priority=0; queued-IOs=0 ============================================================================== ---------------- Host --------------- ... (7 Replies)
Discussion started by: Daniel Gate
7 Replies

10. Shell Programming and Scripting

Moving or copying first rows and last rows into another file

Hi I would like to move the first 1000 rows of my file into an output file and then move the last 1000 rows into another output file. Any help would be great Thanks (6 Replies)
Discussion started by: kylle345
6 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 10:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy