Sponsored Content
Operating Systems Linux Perl program to print previous set of lines once a pattern is matched Post 302644495 by kaav06 on Tuesday 22nd of May 2012 02:54:19 AM
Old 05-22-2012
Hi Scrutinizer,

The expected output is given below:

Code:
*100710 CHOLINERGIC RECEPTOR, NICOTINIC, BETA POLYPEPTIDE 1; CHRNB1
;;CHRNB;;
ACETYLCHOLINE RECEPTOR, MUSCLE, BETA SUBUNIT; ACHRB
*FIELD* AV
.0001
MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL
CHRNB1, VAL266MET
In a 19-year-old female with slow-channel congenital myasthenic syndrome
(601462), Engel et al. (1996) identified a heterozygous 796G-A
transition in exon 8 of the CHRNB1 gene, resulting in a val266-to-met
(V266M) substitution in a conserved residue in the M2 transmembrane
domain of the AChR-beta subunit. Functional expression studies showed
that the V266M mutation slowed the rate of AChR channel closure and
increased the apparent affinity for ACh. The mutation also caused
pathologic channel openings even in the absence of ACh, resulting in a
leaky channel. Cationic overload of the postsynaptic region caused an
endplate myopathy.
.0002
MYASTHENIC SYNDROME, CONGENITAL, SLOW-CHANNEL
CHRNB1, LEU263MET
In a 32-year-old male with slow-channel congenital myasthenic syndrome
(601462), Gomez et al. (1996) identified a heterozygous C-to-A
transversion in the CHRNB1 gene, resulting in a leu263-to-met (L263M)
substitution. Functional expression studies showed that the L263M
mutation interrupted the leucine ring of the AChR channel gate, causing
an 8-fold increase in channel open time and resulting in severe endplate
myopathy and extensive remodeling of the postsynaptic membrane. The
pronounced abnormalities in neuromuscular synaptic architecture and
function and the muscle fiber damage and weakness resulting from a
single point mutation were a dramatic example of a mutation having a
dominant gain of function and of hereditary excitotoxicity.
.0003
MYASTHENIC SYNDROME, CONGENITAL, ASSOCIATED WITH ACETYLCHOLINE RECEPTOR
DEFICIENCY
CHRNB1, 9-BP DEL, NT1276 
In 3 sibs with congenital myasthenia and AChR deficiency (608931),
Quiram et al. (1999) identified compound heterozygosity for 2 mutations
in the CHRNB1 gene. One mutation was a 9-bp deletion (1276del9) in exon
10, resulting in a deletion of 3 codons (426-428) in the long
cytoplasmic loop between the M3 and M4 domains of the protein. The
second mutation was a skipping of exon 8 (100710.0004), truncating the
beta subunit before its M1 transmembrane domain and abolishing surface
expression of pentameric AChR. By coexpressing the 3-codon deleted
subunit with combinations of wildtype subunits in HEK293 cells, Quiram
et al. (1999) demonstrated that the mutation impairs AChR assembly by
disrupting a specific interaction between the beta and delta (100720)
subunits. Studies with related deletion and missense mutations indicated
that secondary structure in this region of the beta subunit is crucial
for interaction with the delta subunit. The findings implied that the
mutated residues are positioned at the interface between beta and delta
subunits and demonstrated contribution of this local region of the long
cytoplasmic loop to AChR assembly.
.0004
MYASTHENIC SYNDROME, CONGENITAL, ASSOCIATED WITH ACETYLCHOLINE RECEPTOR
DEFICIENCY
CHRNB1, EX8DEL 
See 100710.0003 and Quiram et al. (1999).
*FIELD* SA
Beeson et al. (1989)
*FIELD* RF


Last edited by kaav06; 05-25-2012 at 05:19 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print last matched pattern using perl

Hi, If there exist multiple pattern in a file, how can I find the last record matching the pattern through perl. The below script searches for the pattern everywhere in an input file. #! /usr/bin/perl -s -wnl BEGIN { $pattern or warn"Usage: $0 -pattern='RE' \n" and exit 255;... (5 Replies)
Discussion started by: er_ashu
5 Replies

2. Shell Programming and Scripting

How to print lines till till a pattern is matched in loop

Dear All I have a file like this 112534554 446538656 444695656 225696966 226569744 228787874 113536566 443533535 222564552 115464656 225445345 225533234 I want to cut the file into different parts where the first two columns are '11' . The first two columns will be either... (3 Replies)
Discussion started by: anoopvraj
3 Replies

3. Shell Programming and Scripting

Perl script to match a pattern and print lines

Hi I have a file (say 'file1')and I want to search for a first occurence of pattern (say 'ERROR') and print ten lines in the file below pattern. I have to code it in PERL and I am using Solaris 5.9. I appreciate any help with code Thanks Ammu (6 Replies)
Discussion started by: ammu
6 Replies

4. Shell Programming and Scripting

Search for a pattern in a file and print previous lines from a particular point

Hi, I am new to ksh scripting and I have a problem. I have a file in which I have to search for a particular pattern say 'a' then from that line I need to search for another pattern say 'b' in the previous lines and thne print the file from pattern 'b' till the end of file. For eg: ... (2 Replies)
Discussion started by: umaislearning
2 Replies

5. Shell Programming and Scripting

perl script print the lines between two pattern

i have a file as below sample.pl parameter1 argument1 argument2 parameter2 I want out as below argument1 argument2 that is , i want to print all the lines between parameter1 & parameter 2. i tried with the following if($mystring =~ m/parameter1(.*?)parameter2/) (2 Replies)
Discussion started by: roopa
2 Replies

6. Shell Programming and Scripting

sed: how to move matched pattern to end of previous line

Hello, I'm new to this forum. I've been doing a lot of sed work lately and have found many useful tips on this forum. I've hit a roadblock in a project, though, and could really use some help. I have a text file with many lines like the following, i.e., some lines begin with a single word... (3 Replies)
Discussion started by: paroikoi
3 Replies

7. Shell Programming and Scripting

print range of lines matching pattern and previous line

Hi all, on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern. the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/' I need to include the... (1 Reply)
Discussion started by: siriche
1 Replies

8. Shell Programming and Scripting

Print only matched pattern in perl

Hi, I have script like below: #!/usr/local/bin/perl use strict; use warnings; while (<DATA>) { ( my ($s_id) = /^\d+\|(\d+?)\|/ ) ; if ( $s_id == 1 ){ s/^(.*\|)*.*ABC\.pi=(+|+)*.*ABC\.id=(\d+|+).*$/$1$2|$3/s; print "$1$2|$3\n"; (2 Replies)
Discussion started by: sol_nov
2 Replies

9. Shell Programming and Scripting

Sed: how to merge two lines moving matched pattern to end of previous line

hello everyone, im new here, and also programming with awk, sed and grep commands on linux. In my text i have many lines with this config: 1 1 4 3 1 1 2 5 2 2 1 1 1 3 1 2 1 3 1 1 1 2 2 2 5 2 4 1 3 2 1 1 4 1 2 1 1 1 3 2 1 1 5 4 1 3 1 1... (3 Replies)
Discussion started by: satir
3 Replies

10. Shell Programming and Scripting

How to print previous line of multiple pattern matched line?

Hello, I have below format log file, Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Discussion started by: arvindshukla81
6 Replies
Versions(3pm)						User Contributed Perl Documentation					     Versions(3pm)

NAME
Sort::Versions - a perl 5 module for sorting of revision-like numbers SYNOPSIS
use Sort::Versions; @l = sort { versioncmp($a, $b) } qw( 1.2 1.2.0 1.2a.0 1.2.a 1.a 02.a ); ... use Sort::Versions; print 'lower' if versioncmp('1.2', '1.2a') == -1; ... use Sort::Versions; %h = (1 => 'd', 2 => 'c', 3 => 'b', 4 => 'a'); @h = sort { versioncmp($h{$a}, $h{$b}) } keys %h; DESCRIPTION
Sort::Versions allows easy sorting of mixed non-numeric and numeric strings, like the 'version numbers' that many shared library systems and revision control packages use. This is quite useful if you are trying to deal with shared libraries. It can also be applied to applications that intersperse variable-width numeric fields within text. Other applications can undoubtedly be found. For an explanation of the algorithm, it's simplest to look at these examples: 1.1 < 1.2 1.1a < 1.2 1.1 < 1.1.1 1.1 < 1.1a 1.1.a < 1.1a 1 < a a < b 1 < 2 1.1-3 < 1.1-4 1.1-5 < 1.1.6 More precisely (but less comprehensibly), the two strings are treated as subunits delimited by periods or hyphens. Each subunit can contain any number of groups of digits or non-digits. If digit groups are being compared on both sides, a numeric comparison is used, otherwise a ASCII ordering is used. A group or subgroup with more units will win if all comparisons are equal. A period binds digit groups together more tightly than a hyphen. Some packages use a different style of version numbering: a simple real number written as a decimal. Sort::Versions has limited support for this style: when comparing two subunits which are both digit groups, if either subunit has a leading zero, then both are treated like digits after a decimal point. So for example: 0002 < 1 1.06 < 1.5 This won't always work, because there won't always be a leading zero in real-number style version numbers. There is no way for Sort::Versions to know which style was intended. But a lot of the time it will do the right thing. If you are making up version numbers, the style with (possibly) more than one dot is the style to use. USAGE
The function "versioncmp()" takes two arguments and compares them like "cmp". With perl 5.6 or later, you can also use this function directly in sorting: @l = sort versioncmp qw(1.1 1.2 1.0.3); The function "versions()" can be used directly as a sort function even on perl 5.005 and earlier, but its use is deprecated. AUTHOR
Ed Avis <ed@membled.com> and Matt Johnson <mwj99@doc.ic.ac.uk> for recent releases; the original author is Kenneth J. Albanowski <kjahds@kjahds.com>. Thanks to Hack Kampbjorn and Slaven Rezic for patches and bug reports. Copyright (c) 1996, Kenneth J. Albanowski. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.0 2003-08-24 Versions(3pm)
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy