Sponsored Content
Top Forums Shell Programming and Scripting output words between sentences SED Post 302268947 by wrwe on Tuesday 16th of December 2008 03:11:30 PM
Old 12-16-2008
Quote:
Originally Posted by Ikon
Code:
# awk -F 'start' 'BEGIN{RS="end"; OFS="\n"; ORS=""} {print $2}' test.txt
or
# sed -n '/^start/,/^end/{/LABEL$/!p}' test.txt

ok i understand start and end but what is LABEL$ and !p ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed [delete everything between two words]

Hi, I have the following codes below that aims to delete every words between two pattern word. Say I have the files To delete every word between WISH_LIST=" and " I used the below codes (but its not working): #!/bin/sh sed ' /WISH_LIST=\"/ { N /\n.*\"/ {... (3 Replies)
Discussion started by: Orbix
3 Replies

2. Shell Programming and Scripting

search two words in sed

I've following sed command working fine - sed '/search_pattern1/ !s/pattern1/pattern2/" file Now, I want to search two patterns - search_pattern1 and search_pattern2 . How can put these into above sed statement ? Thanks in advance. (12 Replies)
Discussion started by: ajitkumar2
12 Replies

3. Shell Programming and Scripting

sed append words

Hi all, I have a file like one two three for five six seven eight ..... Actually i need to append a label to the words that belong to the 2 column and get: one two_label three for five six_label seven eight .... I was trying with sed inside vim but I can't figure out... (9 Replies)
Discussion started by: Dedalus
9 Replies

4. UNIX for Dummies Questions & Answers

How do I color some words in output?

OK, let's say if we want to filter lines in man and get a different color for the word we are searching we write man find | grep print It will mark all the words containing print red and output only those lines containing it, let's say I want to see the complete manual, but with marked words... (1 Reply)
Discussion started by: arcelivez
1 Replies

5. Shell Programming and Scripting

SED - delete words between two possible words

Hi all, I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line. Let me paste an 2 examples: anything before any string begin few lines of content end1 anything after anything before any... (4 Replies)
Discussion started by: meuser
4 Replies

6. Shell Programming and Scripting

grep words from output file

Hi, By using shell scripit i have save output in one file. I want to grep two words named CLUSTER and CLUSQMGR from that output file. How to grep that. output file would be having below words TYPE(QCLUSTER) ALTDATE(2010-05-17) CLUSTER(QS.CL.MFT1) ... (5 Replies)
Discussion started by: darling
5 Replies

7. Shell Programming and Scripting

Grep words with spaces and save the output

I have a file that contains the schedule for a tournament with 41 teams. The team names have spaces in them. I would like to search for each teams schedule and then save that to that teams file For example Team name: "Team Two" I would like to search for all the games for "Team Two" and... (8 Replies)
Discussion started by: knijjar
8 Replies

8. Shell Programming and Scripting

Swap words using sed

Hi. I have to swap the first and the third word in all lines of a txt file using sed. Separators between words are: any charachter, except intervall. I hope, you'll understand what I want to do. my english is not so good, sorry for that:) (10 Replies)
Discussion started by: T720
10 Replies

9. Shell Programming and Scripting

Count lines and words of a stream output with tail

Hello, I need to tail -f a file output stream and I need to get only lines that contains "get" and "point" in the same line. It doesn't matter the order. Then I need only the text BEFORE "point". I have to count each line and perform other serveral actions after this has performed 3 times.... (9 Replies)
Discussion started by: Kibou
9 Replies

10. Shell Programming and Scripting

Reverse words with sed

Hi guys, I'm wondering what the best way would be to reverse words in a string based on certain characters. For example: echo Word1Word2Word3Word4 | sed ' /\n/ !G s/\(Word.\)\(.*\n\)/&\2\1/ //D ' This returns: Word4Word3Word2Word1 I'm no sed expert but... (2 Replies)
Discussion started by: Subbeh
2 Replies
Ace::Sequence::Homol(3pm)				User Contributed Perl Documentation				 Ace::Sequence::Homol(3pm)

NAME
Ace::Sequence::Homol - Temporary Sequence Homology Class SYNOPSIS
# Get all similarity features from an Ace::Sequence @homol = $seq->features('Similarity'); # sort by score @sorted = sort { $a->score <=> $b->score } @homol; # the last one has the highest score $best = $sorted[$#sorted]; # fetch its associated Ace::Sequence::Homol $homol = $best->target; # print out the sequence name, DNA, start and end print $homol->name,' ',$homol->start,'-',$homol->end," "; print $homol->asDNA; DESCRIPTION
Ace::Sequence::Homol is a subclass of Ace::Object (not Ace::Sequence) which is specialized for returning information about a DNA or protein homology. This is a temporary placeholder for a more sophisticated homology class which will include support for alignments. OBJECT CREATION
You will not ordinarily create an Ace::Sequence::Homol object directly. Instead, objects will be created in response to an info() or group() method call on a similarity feature in an Ace::Sequence::Feature object. If you wish to create an Ace::Sequence::Homol object directly, please consult the source code for the new() method. OBJECT METHODS
Most methods are inherited from Ace::Object. The following methods are also supported: start() $start = $homol->start; Returns the start of the area that is similar to the Ace::Sequence::Feature from which his homology was derived. Coordinates are relative to the target homology. end() $end = $homol->end; Returns the end of the area that is similar to the Ace::Sequence::Feature from which his homology was derived. Coordinates are relative to the target homology. asString() $label = $homol->asString; Returns a human-readable identifier describing the nature of the feature. The format is: $name/$start-$end for example: HUMGEN13/1-67 This method is also called automatically when the object is treated in a string context. SEE ALSO
Ace, Ace::Object, Ace::Sequence,Ace::Sequence::FeatureList, Ace::Sequence::Feature, GFF AUTHOR
Lincoln Stein <lstein@w3.org> with extensive help from Jean Thierry-Mieg <mieg@kaa.crbm.cnrs-mop.fr> Copyright (c) 1999, Lincoln D. Stein This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty. perl v5.14.2 2001-09-17 Ace::Sequence::Homol(3pm)
All times are GMT -4. The time now is 05:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy