Sponsored Content
Full Discussion: Deleting words and sorting
Top Forums UNIX for Dummies Questions & Answers Deleting words and sorting Post 302545768 by Xterra on Tuesday 9th of August 2011 12:41:44 PM
Old 08-09-2011
Problem with the last section

Everything is fine but this part is giving me an error:
Code:
sort -V -k1,1

Quote:
sort: invalid option -- v
I do not see the '-v' option under sed. Am I missing something here?

---------- Post updated at 12:41 PM ---------- Previous update was at 12:39 PM ----------

That took care of it!
Code:
sed -n '
/Tree/{
s/^.*\(Tree\)\([0-9]\+\).*$/\1 \2:/
h
}
/Distance (/{
s|^.*: \([0-9.]\+\) / [0-9.]\+$|\1|
x
G
s/\n//p
}
' INPUTFILE | sort -n -k2,2 | sed 's/ //'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

deleting symbols and characters between two words

Hi Please tell me how could i delete symbols, whitespaces, characters, words everything between two words in a line. Let my file is aaa BB ccc ddd eee FF kkk xxx 123456 BB 44^& iop FF 999 xxx uuu rrr BB hhh nnn FF 000 I want to delete everything comes in between BB and FF( deletion... (3 Replies)
Discussion started by: rish_max
3 Replies

2. UNIX for Dummies Questions & Answers

need help sorting/deleting non-unique things

I don't really know much about UNIX commands, so if someone could help me understand how to do this, I'd really appreciate it. I have a text file with data that looks like this (filename: numbers.txt): 1 1 1 1 1 1 1 1 1 2 1 1_2 2_1 1 1 1 1 1 1 1 1 2 1 2 1_2 2_1 1 1 1 1 1 1 1 1 2 1 2 1_2 2_1... (12 Replies)
Discussion started by: zac100
12 Replies

3. Shell Programming and Scripting

deleting blank line and row containing certain words in single sed command

Hi Is it possible to do the following in a single command /usr/xpg4/bin/sed -e '/rows selected/d' /aemu/CALLAUTO/callauto.txt > /aemu/CALLAUTO/callautonew.txt /usr/xpg4/bin/sed -e '/^$/d' /aemu/CALLAUTO/callautonew.txt > /aemu/CALLAUTO/callauto_new.txt exit (1 Reply)
Discussion started by: aemunathan
1 Replies

4. Shell Programming and Scripting

Deleting words between tags

Hi !!! I need to write a script(ksh) that deletes any character outside <start> tag and </start> from a file. For eg: $cat file.txt <start> ad bd </start> as</start> <start> d e f mb<start>mu g h i (7 Replies)
Discussion started by: PRKS
7 Replies

5. Shell Programming and Scripting

Need some help deleting words from a line which are not my "Keyword"

Hi, i'm currently new to scripting and need some help with my problem, so i'll jump right to it. I have a file containing text, the file is pretty big so for the sake of this i'll just say this is the text: John id number is abc34938 Grahams id number is pending id number abc64334 is Bob's ... (14 Replies)
Discussion started by: linuxkid
14 Replies

6. UNIX for Dummies Questions & Answers

deleting words in list with more than 2 identical adjacent characters

Morning Guys & Gals, I am trying to figure out a way to remove lines from a file that have more than 2 identical characters in sequence.. So if for instance the list would look like ; the output would be ; I can't seem to get my head around perl (among many other... (7 Replies)
Discussion started by: TAPE
7 Replies

7. UNIX for Dummies Questions & Answers

Sorting words based on length

i need to write a bash script that recive a list of varuables kaka pele ronaldo beckham zidane messi rivaldo gerrard platini i need the program to print the longest word of the list. word in the output appears on a separate line and word order in the output is in the order Llachsicografi costs.... (1 Reply)
Discussion started by: yairpg
1 Replies

8. Shell Programming and Scripting

Sorting a list of words one per line by their ending

Hello, My OS is Windows and therefore DOS. Hence I have no access to Unix tools. I am trying to sort a file in Urdu by the character by which it ends. Each word is on a separate line. As input, an example in English would help: fruit banana apple pear house I need the sort to be on the... (5 Replies)
Discussion started by: gimley
5 Replies

9. UNIX for Dummies Questions & Answers

Deleting words between every appearance of two words

Hi there, newbie there. I've been browsing the forums hoping to find a solution that answers a problem similar to what I need, but haven't had much luck. Any help would be greatly appreciated. Thanks! I need to delete a bunch of text between every appearance of two words in a really large file... (3 Replies)
Discussion started by: lendl
3 Replies

10. Shell Programming and Scripting

Deleting a list of words from a text file

Hello, I have a list of words separated by spaces I am trying to delete from a text file, and I could not figure out what is the best way to do this. what I tried (does not work) : delete="password key number verify" arr=($delete) for i in arr { sed "s/\<${arr}\>]*//g" in.txt } >... (5 Replies)
Discussion started by: Hawk4520
5 Replies
Bio::Taxonomy::Taxon(3pm)				User Contributed Perl Documentation				 Bio::Taxonomy::Taxon(3pm)

NAME
Bio::Taxonomy::Taxon - Generic Taxonomic Entity object SYNOPSIS
# NB: This module is deprecated. Use Bio::Taxon instead. use Bio::Taxonomy::Taxon; my $taxonA = Bio::Taxonomy::Taxon->new(); my $taxonL = Bio::Taxonomy::Taxon->new(); my $taxonR = Bio::Taxonomy::Taxon->new(); my $taxon = Bio::Taxonomy::Taxon->new(); $taxon->add_Descendents($taxonL); $taxon->add_Descendents($taxonR); my $species = $taxon->species; DESCRIPTION
Makes a taxonomic unit suitable for use in a taxonomic tree AUTHOR
Dan Kortschak email kortschak@rsbs.anu.edu.au CONTRIBUTORS
Sendu Bala: bix@sendu.me.uk APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : my $obj = Bio::Taxonomy::Taxon->new(); Function: Builds a new Bio::Taxonomy::Taxon object Returns : Bio::Taxonomy::Taxon Args : -descendents => array pointer to descendents (optional) -branch_length => branch length [integer] (optional) -taxon => taxon -id => unique taxon id for node (from NCBI's list preferably) -rank => the taxonomic level of the node (also from NCBI) add_Descendent Title : add_Descendent Usage : $taxon->add_Descendent($taxon); Function: Adds a descendent to a taxon Returns : number of current descendents for this taxon Args : Bio::Taxonomy::Taxon boolean flag, true if you want to ignore the fact that you are adding a second node with the same unique id (typically memory location reference in this implementation). default is false and will throw an error if you try and overwrite an existing node. each_Descendent Title : each_Descendent($sortby) Usage : my @taxa = $taxon->each_Descendent; Function: all the descendents for this taxon (but not their descendents i.e. not a recursive fetchall) Returns : Array of Bio::Taxonomy::Taxon objects Args : $sortby [optional] "height", "creation" or coderef to be used to sort the order of children taxa. remove_Descendent Title : remove_Descendent Usage : $taxon->remove_Descedent($taxon_foo); Function: Removes a specific taxon from being a Descendent of this taxon Returns : nothing Args : An array of Bio::taxonomy::Taxon objects which have be previously passed to the add_Descendent call of this object. remove_all_Descendents Title : remove_all_Descendents Usage : $taxon->remove_All_Descendents() Function: Cleanup the taxon's reference to descendents and reset their ancestor pointers to undef, if you don't have a reference to these objects after this call they will be cleanedup - so a get_nodes from the Tree object would be a safe thing to do first Returns : nothing Args : none get_Descendents Title : get_Descendents Usage : my @taxa = $taxon->get_Descendents; Function: Recursively fetch all the taxa and their descendents *NOTE* This is different from each_Descendent Returns : Array or Bio::Taxonomy::Taxon objects Args : none ancestor Title : ancestor Usage : $taxon->ancestor($newval) Function: Set the Ancestor Returns : value of ancestor Args : newvalue (optional) branch_length Title : branch_length Usage : $obj->branch_length($newval) Function: Example : Returns : value of branch_length Args : newvalue (optional) description Title : description Usage : $obj->description($newval) Function: Returns : value of description Args : newvalue (optional) rank Title : rank Usage : $obj->rank($newval) Function: Set the taxonomic rank Returns : taxonomic rank of taxon Args : newvalue (optional) taxon Title : taxon Usage : $obj->taxon($newtaxon) Function: Set the name of the taxon Example : Returns : name of taxon Args : newtaxon (optional) id Title : id Usage : $obj->id($newval) Function: Example : Returns : value of id Args : newvalue (optional) internal_id Title : internal_id Usage : my $internalid = $taxon->internal_id Function: Returns the internal unique id for this taxon (a monotonically increasing number for this in-memory implementation but could be a database determined unique id in other implementations) Returns : unique id Args : none _creation_id Title : _creation_id Usage : $obj->_creation_id($newval) Function: a private method signifying the internal creation order Returns : value of _creation_id Args : newvalue (optional) is_Leaf Title : is_Leaf Usage : if( $node->is_Leaf ) Function: Get Leaf status Returns : boolean Args : none to_string Title : to_string Usage : my $str = $taxon->to_string() Function: For debugging, provide a taxon as a string Returns : string Args : none height Title : height Usage : my $len = $taxon->height Function: Returns the height of the tree starting at this taxon. Height is the maximum branchlength. Returns : The longest length (weighting branches with branch_length) to a leaf Args : none invalidate_height Title : invalidate_height Usage : private helper method Function: Invalidate our cached value of the taxon's height in the tree Returns : nothing Args : none classify Title : classify Usage : @obj->classify() Function: a method to return the classification of a species Returns : name of taxon and ancestor's taxon recursively Args : boolean to specify whether we want all taxa not just ranked levels has_rank Title : has_rank Usage : $obj->has_rank($rank) Function: a method to query ancestors' rank Returns : boolean Args : $rank has_taxon Title : has_taxon Usage : $obj->has_taxon($taxon) Function: a method to query ancestors' taxa Returns : boolean Args : Bio::Taxonomy::Taxon object distance_to_root Title : distance_to_root Usage : $obj->distance_to_root Function: a method to query ancestors' taxa Returns : number of links to root Args : recent_common_ancestor Title : recent_common_ancestor Usage : $obj->recent_common_ancestor($taxon) Function: a method to query find common ancestors Returns : Bio::Taxonomy::Taxon of query or undef if no ancestor of rank Args : Bio::Taxonomy::Taxon species Title : species Usage : $obj=$taxon->species; Function: Returns a Bio::Species object reflecting the taxon's tree position Returns : a Bio::Species object Args : none perl v5.14.2 2012-03-02 Bio::Taxonomy::Taxon(3pm)
All times are GMT -4. The time now is 08:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy