Sponsored Content
Top Forums Shell Programming and Scripting Matching a pattern 250 characters up and down stream Post 302663205 by jacobs.smith on Wednesday 27th of June 2012 05:05:56 PM
Old 06-27-2012
Quote:
Originally Posted by anurupa777
hii all

i have a file a which contains some thing like this
strand smthg position
+ yyx 3020
- yyw 10,000

now i have another file (file2) which contains the data starting from 1 to n positions

i want to refer first file if + appears it should go to eg 3020 position in file 2 and see for a pattern match say $abc at 250 characters after 3020 (i,e., 3270).

if " -" appears it shud go 250 characters before 3020 and search for the pattern $abc.
how can i do it
Please post a bit bigger datasets of your both input files and your expected output files.

Please use code tags when u submit ur data.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comment/delete a particular pattern starting from second line of the matching pattern

Hi, I have file 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies

2. Shell Programming and Scripting

Truncate the content within alt attribute to first 250 characters.

I have a xml file which contains image tag as follows: <image><img src="wstc_0007_0007_0_img0001.jpg" width="351" height="450" alt="This is the cover page. Brazil &#x2022; Japan &#x2022; Korea &#x2022; Mexico &#x2022; Singapore &#x2022; Spain" type="photograph" orient="portrait"/></image> ... (5 Replies)
Discussion started by: parshant_bvcoe
5 Replies

3. Shell Programming and Scripting

counting the lines matching a pattern, in between two pattern, and generate a tab

Hi all, I'm looking for some help. I have a file (very long) that is organized like below: >Cluster 0 0 283nt, >01_FRYJ6ZM12HMXZS... at +/99% 1 279nt, >01_FRYJ6ZM12HN12A... at +/99% 2 281nt, >01_FRYJ6ZM12HM4TS... at +/99% 3 283nt, >01_FRYJ6ZM12HM946... at +/99% 4 279nt,... (4 Replies)
Discussion started by: d.chauliac
4 Replies

4. UNIX for Dummies Questions & Answers

pattern matching w/ unexpected characters

how do i check if the first character is a parenthese in pattern matching? if ] obviously doesnt work. How do I use it to compare so it doesnt try to use it to group. (5 Replies)
Discussion started by: questionasker
5 Replies

5. Shell Programming and Scripting

pattern match in live stream

hi! i have a situation like this where i have to analyse the live log generated from /bin/scp -v you@example.com is if a pattern like say "Too many connections" comes i shud be able to identify it . (3 Replies)
Discussion started by: phpsnook
3 Replies

6. Shell Programming and Scripting

Matching a pattern between two characters (sed)

Hi there, I have a file with lines like these: 0105:ffff0000:001b:01f4:25:434 0299:ffff0000:0009:01f4:2:319 02d2:ffff0000:000e:01f4:2:507 The above values are split up using ":" characters. I would like capture each value, no matter what length. Take for example the first line... (8 Replies)
Discussion started by: MastaG
8 Replies

7. Shell Programming and Scripting

Removing all lines prior to the last pattern in a file/stream

Hi all, I didn't find anything that specifically answers this after searching for a bit, so please forgive me if this has been covered before. I'm looking to delete all lines prior to the last occurrence of a string in a file or stream from within a shell script (bash.) A bit of... (4 Replies)
Discussion started by: LivinFree
4 Replies

8. Shell Programming and Scripting

Deleting lines from a stream after matching a pattern

Hi, I have a requirement to to an ldapsearch and remove the shadow attributes in the output file. What I do is ldapsearch() | operation to remove shadow > FILE The ldapsearch gives output like this(with same line formation): objectClass: FSConfig objectClass: extensibleObject fsCAIP:... (10 Replies)
Discussion started by: lorzinian
10 Replies

9. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
TFBS::Matrix::Alignment(3pm)				User Contributed Perl Documentation			      TFBS::Matrix::Alignment(3pm)

NAME
TFBS::Matrix::Alignment - class for alignment of PFM objects SYNOPSIS
o Making an alignment: (See documentation of individual TFBS::DB::* modules to learn how to connect to different types of pattern databases and retrieve TFBS::Matrix::* objects from them.) my $db_obj = TFBS::DB::JASPAR2->new (-connect => ["dbi:mysql:JASPAR2:myhost", "myusername", "mypassword"]); my $pfm1 = $db_obj->get_Matrix_by_ID("M0001", "PFM"); my $pfm2 = $db_obj->get_Matrix_by_ID("M0002", "PFM"); my $alignment= new TFBS::Matrix::Alignment( -pfm1=>$pfm1, -pfm2=>$pfm2, -binary=>"/TFBS/Ext/matrix_aligner", ); DESCRIPTION
TFBS::Matrix::Alignment is a class for representing and performing pairwise alignments of profiles (in the form of TFBS::PFM objects) Alignments are preformed using a semi-global variant of the Needleman-Wunsch algorithm that only permits the opening of one internal gap. Fore reference, the algorithm is described in Sandelin et al Funct Integr Genomics. 2003 Jun 25 FEEDBACK
Please send bug reports and other comments to the author. AUTHOR - Boris Lenhard Boris Lenhard <Boris.Lenhard@cgb.ki.se> APPENDIX
The rest of the documentation details each of the object methods. Internal methods are preceded with an underscore. new Title : new Usage : my $alignment = TFBS::Matrix::Alignment->new(%args) Function: constructor for the TFBS::Matrix::Alignment object Returns : a new TFBS::Matrix::Alignment object Args : # you must specify: -pfm1, # a TFBS::Matrix::PFM object -pfm2, # another TFBS::Matrix::PFM object -binary, # a valid path to the comparison algorithm (matrixalign) ####### -ext_penalty #OPTIONAL gap extension penalty in Needleman-Wunsch algorithmstring. Default 0.01 -open_penalty, #OPTIONAL gap opening penalty in Needleman-Wunsch algorithmstring. Default 3.0 score Title : score Usage : my $score = $alignmentobject->score(); Function: access an alignment score (where each aligned position can contribute max 2) Returns : a floating point number Args : none score Title : gaps Usage : my $nr_of_gaps = $alignmentobject->gaps(); Function: access the number of gaps in an alignment Returns : an integer Args : none length Title : length Usage : my $length = $alignmentobject->length(); Function: access the length of an alignment (ie thenumber of aligned positions) Returns : an integer Args : none strand Title : strand Usage : my $strand = $alignmentobject->strand(); Function: access the oriantation of the aligned patterns: ++= oriented as input +-= second pattern is reverse-complemented Returns : a string Args : none alignment Title : alignment Usage : my $alignment_string = $alignmentobject->alignment(); Function: access a string describing the alignment Returns : an string, where each number refers to a position in repective PFM. Position numbering is according to orientation: ie if the second profile is reversed, position 1 corresponds to the last position in the input profile. Gaps are denoted as - . RXR-VDR - 1 2 3 - 4 5 - PPARgamma-RXRal 1 2 3 4 5 6 7 8 Args : none POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 39: You forgot a '=back' before '=head1' perl v5.14.2 2008-01-24 TFBS::Matrix::Alignment(3pm)
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy