Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Removing rows that contain non-unique column entry Post 302924204 by Scrutinizer on Friday 7th of November 2014 01:08:49 AM
Old 11-07-2014
Try something like:
Code:
awk -F, 'NR==FNR{A[$3]++; B[$13]++; next} A[$3]==1 && B[$13]==1' infile infile

Note: the input file is specified twice. I have used a comma separator here as field separator, so for that to work you need to use a comma as field separator when you export the spreadsheet.

It is untested since there is no text sample... Please post one.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Removing the rest of line from the second entry of an expression

Dear people, can you please enlighten: I need to do a (most probably) very simple thing but couldn't figure how. I have files with lots of lines starting with a fixed expression: Query=. (the dot is a space) followed by different combinations of characters including special ones such... (5 Replies)
Discussion started by: roussine
5 Replies

2. Shell Programming and Scripting

for each different entry in column 1 extract maximum values from column 2 in unix/awk

Hello, I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2 SDF4 -0.211654 SDF4 0.978068 ... (1 Reply)
Discussion started by: Diya123
1 Replies

3. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

4. Shell Programming and Scripting

unique entry add values

Hi, I have a file with 3 columns ABC 3 1 ABC 5 1 XYZ 4 2 DEF 3 2 DEF 4 1 DEF 6 1 MNO 5 5 JKL 3 2 JKL 4 2 PQR 12 1 For each unique entry in column 1 I want to add values in column 2 and column3 o/p ABC 8 2 XYZ 4 2 (1 Reply)
Discussion started by: Diya123
1 Replies

5. UNIX for Dummies Questions & Answers

Delete rows with unique value for specific column

Hi all I have a file which looks like this 1234|1|Jon|some text|some text 1234|2|Jon|some text|some text 3453|5|Jon|some text|some text 6533|2|Kate|some text|some text 4567|3|Chris|some text|some text 4567|4|Maggie|some text|some text 8764|6|Maggie|some text|some text My third column is my... (9 Replies)
Discussion started by: A-V
9 Replies

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

7. Shell Programming and Scripting

Delete unique rows - optimize script

Hi all, I have the following input - the unique row key is 1st column cat file.txt A response C request C response D request C request C response E request The desired output should be C request (7 Replies)
Discussion started by: varu0612
7 Replies

8. Shell Programming and Scripting

Unique extraction of rows

I do have a tab delimited file of the following format: 431 kat1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 432 kat2 2 NA NA NA NA NA NA NA NA NA NA NA NA NA 433 KATe NA 3 NA NA 6 NA NA NA 10 11 NA NA NA NA 542 Kaed 2 NA NA NA NA NA NA NA NA NA NA NA NA NA 543 hkwuy NA NA NA NA 6 NA NA NA NA 11 NA NA... (11 Replies)
Discussion started by: Kanja
11 Replies

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

10. UNIX for Beginners Questions & Answers

Awk/sed summation of one column based on some entry in first column

Hi All , I am having an input file as stated below Input file 6 ddk/djhdj/djhdj/Q 10 0.5 dhd/jdjd.djd.nd/QB 01 0.5 hdhd/jd/jd/jdj/Q 10 0.5 512 hd/hdh/gdh/Q 01 0.5 jdjd/jd/ud/j/QB 10 0.5 HD/jsj/djd/Q 01 0.5 71 hdh/jjd/dj/jd/Q 10 0.5 ... (5 Replies)
Discussion started by: kshitij
5 Replies
Bio::Tools::Primer3(3pm)				User Contributed Perl Documentation				  Bio::Tools::Primer3(3pm)

NAME
Bio::Tools::Primer3 - Create input for and work with the output from the program primer3 SYNOPSIS
# parse primer3 output to get some data # this is also called from Bio::Tools::Run::Primer3 use Bio::Tools::Primer3; # read a primer3 output file my $p3 = Bio::Tools::Primer3->new(-file=>"data/primer3_output.txt"); # how many results were there? my $num = $p3->number_of_results; print "There were $num results "; # get all the results my $all_results = $p3->all_results; print "ALL the results "; foreach my $key (keys %{$all_results}) { print "$key ${$all_results}{$key} "; } # get specific results my $result1 = $p3->primer_results(1); print "The first primer is "; foreach my $key (keys %{$result1}) { print "$key ${$result1}{$key} "; } # get the results as a Bio::Seq::PrimedSeq stream my $primer = $p3->next_primer; print "The left primer in the stream is ", $primer->get_primer('-left_primer')->seq->seq, " "; DESCRIPTION
Bio::Tools::Primer3 creates the input files needed to design primers using primer3 and provides mechanisms to access data in the primer3 output files. This module provides a bioperl interface to the program primer3. See http://www-genome.wi.mit.edu/genome_software/other/primer3.html for details and to download the software. This module is based on one written by Chad Matsalla (bioinformatics1@dieselwurks.com) I have ripped some of his code, and added a lot of my own. I hope he is not mad at me! This is probably best run in one of the two following ways: i. To parse the output from Bio::Tools::Run::Primer3. You will most likely just use next_primer to get the results from Bio::Tools::Run::Primer3. ii. To parse the output of primer3 handed to it as a file name. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Rob Edwards redwards@utmem.edu Based heavily on work of Chad Matsalla bioinformatics1@dieselwurks.com CONTRIBUTORS
Brian Osborne bosborne at alum.mit.edu APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new() Usage : my $primer3 = Bio::Tools::Primer3->new(-file=>$file) to read a primer3 output file. Function: Parse primer3 output Returns : Does not return anything. If called with a filename will allow you to retrieve the results Args : -file (optional) file of primer3 results to parse -verbose (optional) set verbose output Notes : number_of_results Title : number_of_results() Usage : $primer3->number_of_results() Function: Retrieve the number of primers returned from Primer3. Returns : A scalar Args : None Notes : This returns the count of the primers returned by Primer3 (aka how many of them there are). This is one more than the maximum offset into the zero based list of primers that is accessed by primer_results(). all_results Title : all_results() Usage : $primer3->all_results() to print all results or $primer3->all_results('primer3 result name', 'other results') to return a specific result Function: Retrieve the results returned from Primer3. Returns : A reference to a hash Args : Optional array of results to retrieve primer_results Title : primer_results() Usage : $primer3->primer_results(2) to print results for the third choice primer (indexed on 0) Function: Retrieve the results returned from Primer3 for specific primer pairs. Returns : A reference to a hash Args : A number between 0 and the maximum number of primers to retrieve _readfile Title : _readfile() Usage : $self->_readfile(); Function: An internal function that reads a file and sets up the results Returns : Nothing. Args : None Notes : next_primer Title : next_primer() Usage : while (my $primed_seq = $primer3->next_primer()) { Function: Retrieve the primed sequence and a primer pair, one at a time Returns : Returns a Bio::Seq::PrimedSeq feature, one at a time Args : None Notes : Use $primed_seq->annotated_seq to get an annotated sequence object you can write out. primer_stream Title : primer_stream() Usage : while (my $primed_seq = $primer3->primer_stream()) { Function: Retrieve the primer/sequences one at a time Returns : Returns a Bio::Seq::PrimedSeq feature, one at a time Args : None Notes : Deprecated, just a link to next_primer _separate Title : _separate() Usage : $self->_separate(); Function: An internal function that groups the results by number (e.g. primer pair 1, etc) Returns : Nothing. Args : None Notes : _set_variable Title : _set_variable() Usage : $self->_set_variable('variable name', 'value'); Function: An internal function that sets a variable Returns : Nothing. Args : None Notes : Used to set $self->{results} and $self->seqobject perl v5.14.2 2012-03-02 Bio::Tools::Primer3(3pm)
All times are GMT -4. The time now is 09:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy