Sponsored Content
Top Forums Shell Programming and Scripting Diamond operator in Until Statement (perl) Post 302267322 by radoulov on Friday 12th of December 2008 06:29:00 AM
Old 12-12-2008
Another approach:

Code:
perl -ne'BEGIN { $Sep = "=" x 65 }
  /^ID   (\w+)/ and $Gene = $1;
  /^DE   RecName: Full=([^;]*)/ and $Name = $1;
  if (/^CC   -!- FUNCTION:/../CC   -!- SUBCELLULAR/) {
    $Func .= $1."\n   " if 
	  !/SUBCELLULAR/ && (/(FUNCTION:.*)/ || /CC(.*)/)
	}
  if (/^CC   -!- TISSUE SPECIFICITY:/../^CC   -!- SIMILARITY:/) {
    $Spec .= $1."\n   " if 
	  !/CC   -!- SIMILARITY:/ && (/(TISSUE SPECIFICITY:.*)/ || /CC(.*)/)
	}
  printf "$Sep\n\nGENE: %s\n\nNAME: %s\n\n%s\n%s\n\n", $Gene, $Name, 
    $Func, $Spec and ($Func, $Spec) = undef if eof
  '  Batch*

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scalar variable assignment in perl + { operator

When reading over some perl code in a software document, I came across an assignment statement like this $PATH = ${PROJECT}/......./.... In this particular form of scalar variable assignment, what does the curly braces operators do ? Also, what is the benefit in doing scalar assignment this... (3 Replies)
Discussion started by: JamesGoh
3 Replies

2. Shell Programming and Scripting

chomp like Perl operator in Bash

I am sure there should exist a chomp like Perl operator in Bash using which I can literally remove new line characters as show below: Any clue? (3 Replies)
Discussion started by: paragkalra
3 Replies

3. Shell Programming and Scripting

cannot properly employ "or" operator in an if statement (bash)

Hi, I have a variable, $sername, and I would like to display this variable only if it *does not* contain either of these two tags: *DTI*FA* or *DIFF*FA*. I think the syntax for my 'or' operator is off. The variable $sername is continuously changing in an outer loop (not shown), but at the... (4 Replies)
Discussion started by: goodbenito
4 Replies

4. Shell Programming and Scripting

Perl Diamond Operator

I know that when using 'while (<FILE>) {}', Perl reads only one line of the file at one time, and store it in '$_'. Can I change some parameters so that 'while (<>) {}' can read more than one lines, like 2 or 5 lines at one time? Thanks for the help! (1 Reply)
Discussion started by: zx1106
1 Replies

5. Shell Programming and Scripting

How to write If statement using && and operator in Unix

Hi What is the syntax for if statement using && and || operator? if && ] || here its giving me an error to this if statement any suggestion?? (2 Replies)
Discussion started by: Avi
2 Replies

6. UNIX for Dummies Questions & Answers

awk if statement / equals operator

Hi, I was hoping someone could explain this please :) I'm using bash, scientific linux... and I don't know what else you need to know. With awk '{ if( 0.3 == 0.1*3) print $1}' file.dat nothing will be printed since apparently the two numbers do not equate. (Using 0.3 != 0.1*3 is seen... (4 Replies)
Discussion started by: Golpette
4 Replies

7. Shell Programming and Scripting

awk diamond code golf (just for fun!)

Hey guys, This is purely just a little bit of fun with awk. I realize this this isn't that constructive so please remove if need be. Your goal: Create a one line awk script that generates a diamond shape of any size. Both the size of the diamond (measured by its middle line) and the... (7 Replies)
Discussion started by: pilnet101
7 Replies

8. Shell Programming and Scripting

Like operator in IF statement

how can i use like operator in IF statement. Below is correct format, please guide if ; then CT_ACT_FILE_NAME=`echo FINACLE' else CT_ACT_FILE_NAME=`echo not listed' fi ---------- Post updated at 04:58 PM ---------- Previous update was at 04:56 PM ---------- Please use CODE... (6 Replies)
Discussion started by: rizwan.shaukat
6 Replies

9. Shell Programming and Scripting

To print diamond asterisk pattern based on inputs

I have to print the number of stars that increases on each line from the minimum number until it reaches the maximum number, and then decreases until it goes back to the minimum number. After printing out the lines of stars, it should also print the total number of stars printed. I have tried... (13 Replies)
Discussion started by: rohit_shinez
13 Replies
CORELIST(1)						 Perl Programmers Reference Guide					       CORELIST(1)

NAME
corelist - a commandline frontend to Module::CoreList DESCRIPTION
See Module::CoreList for one. SYNOPSIS
corelist -v corelist [-a|-d] <ModuleName> | /<ModuleRegex>/ [<ModuleVersion>] ... corelist [-v <PerlVersion>] [ <ModuleName> | /<ModuleRegex>/ ] ... OPTIONS
-a lists all versions of the given module (or the matching modules, in case you used a module regexp) in the perls Module::CoreList knows about. corelist -a utf8 utf8 was first released with perl 5.006 5.006 undef 5.006001 undef 5.006002 undef 5.007003 1.00 5.008 1.00 5.008001 1.02 5.008002 1.02 5.008003 1.02 5.008004 1.03 5.008005 1.04 5.008006 1.04 5.008007 1.05 5.008008 1.06 5.009 1.02 5.009001 1.02 5.009002 1.04 5.009003 1.06 -d finds the first perl version where a module has been released by date, and not by version number (as is the default). -? or -help help! help! help! to see more help, try --man. -man all of the help -v lists all of the perl release versions we got the CoreList for. If you pass a version argument (value of $], like 5.00503 or 5.008008), you get a list of all the modules and their respective versions. (If you have the "version" module, you can also use new-style version numbers, like 5.8.8.) In module filtering context, it can be used as Perl version filter. As a special case, if you specify the module name "Unicode", you'll get the version number of the Unicode Character Database bundled with the requested perl versions. EXAMPLES
$ corelist File::Spec File::Spec was first released with perl 5.005 $ corelist File::Spec 0.83 File::Spec 0.83 was released with perl 5.007003 $ corelist File::Spec 0.89 File::Spec 0.89 was not in CORE (or so I think) $ corelist File::Spec::Aliens File::Spec::Aliens was not in CORE (or so I think) $ corelist /IPC::Open/ IPC::Open2 was first released with perl 5 IPC::Open3 was first released with perl 5 $ corelist /MANIFEST/i ExtUtils::Manifest was first released with perl 5.001 $ corelist /Template/ /Template/ has no match in CORE (or so I think) $ corelist -v 5.8.8 B B 1.09_01 $ corelist -v 5.8.8 /^B::/ B::Asmdata 1.01 B::Assembler 0.07 B::Bblock 1.02_01 B::Bytecode 1.01_01 B::C 1.04_01 B::CC 1.00_01 B::Concise 0.66 B::Debug 1.02_01 B::Deparse 0.71 B::Disassembler 1.05 B::Lint 1.03 B::O 1.00 B::Showlex 1.02 B::Stackobj 1.00 B::Stash 1.00 B::Terse 1.03_01 B::Xref 1.01 COPYRIGHT
Copyright (c) 2002-2007 by D.H. aka PodMaster Currently maintained by the perl 5 porters <perl5-porters@perl.org>. This program is distributed under the same terms as perl itself. See http://perl.org/ or http://cpan.org/ for more info on that. perl v5.14.2 2014-09-30 CORELIST(1)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy