Sorry, that's not good as you have to specify an existing start and end, ie. .3 and .22. I have no better idea atm, but I bet someone will come up with a better code soon.
Your code doesn't work because [1,22] is not a range in regular expressions. Afaik it would be written [1-22] but I don't get it working either
if the column1 and 2 in both files has same key (for example "a" and "a1") compare each first key value(a1 of a) of input2 (for example 1-4 or 65-69 not 70-100 or 44-40 etc) with all the values in input1.
if the range of first key value in input2 is outof range in input1 values named it as out... (54 Replies)
Hi,
I'm trying to match a filename that could be called anything from vout001 to vout252 and was trying to do a small test but I'm not getting the result I thought I would..
Can some one tell me what I'm doing wrong?
*****@********>echo $mynumber ... (4 Replies)
Hi,
I have log file which rolls out every second which is as this.
HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
I am trying to create a script that will use the position in column A ($1) in 48850.txt and search for it in columns B ($2) in gene.txt. Then when it finds a match it copies the text in column A ($1) and places it in column C ($3) of 48850.txt. I have attached the files. Thank you :).
The... (2 Replies)
In the files attached, I am trying to:
if Files.txt $1 is in the range of Exons.txt $1, then in Files.txt $4 the value from Exons.txt $3 is copied else if no match is found Exons.txt $3 = "Intron"
For example, the first value in File.txt $1 is chr1:14895-14944 and is not found in any range... (4 Replies)
Hi,
I have logfile like this..
=== 2014-02-09 15:46:59,936 INFO RequestContext - URL: '/eyisp/sc/skins/EY/images/pickers/comboBoxPicker_Over.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko': Unsupported with Accept-Encoding header
=== 2015-02-09... (8 Replies)
I am trying to use awk to match the NM_ in file with $1 of id which is tab-delimited. The NM_ will always be in the line of file that starts with > and be after the second _. When there is a match between each NM_ and id, then the value of $2 in id is substituted or used to update the NM_. Each NM_... (3 Replies)
Input: START
OS:: UNIX
Release: xxx
Version: xxx
END
START
OS:: LINUX
Release: xxx
Version: xxx
END
START
OS:: Windows
Release: xxx
Version: xxx
ENDHere i am trying to get all the information between START and END, only if i could match OS Type.
I can get all the data between the... (3 Replies)
Discussion started by: Dharmaraja
3 Replies
LEARN ABOUT DEBIAN
string::glob::permute
Permute(3pm) User Contributed Perl Documentation Permute(3pm)NAME
String::Glob::Permute - Expand {foo,bar,baz}[2-4] style string globs
SYNOPSIS
use String::Glob::Permute qw( string_glob_permute );
my $pattern = "host{foo,bar,baz}[2-4]";
for my $host (string_glob_permute( $pattern )) {
print "$host
";
}
# hostfoo2
# hostbar2
# hostbaz2
# hostfoo3
# hostbar3
# hostbaz3
# hostfoo4
# hostbar4
# hostbaz4
DESCRIPTION
The "string_glob_permute()" function provided by this module expands glob-like notations in text strings and returns all possible
permutations.
For example, to run a script on hosts host1, host2, and host3, you might write
@hosts = string_glob_permute( "host[1-3]" );
and get a list of hosts back: ("host1", "host2", "host3").
Ranges with gaps are also supported, just separate the blocks by commas:
@hosts = string_glob_permute( "host[1-3,5,9]" );
will return ("host1", "host2", "host3", "host5", "host9").
And, finally, using curly brackets and comma-separated lists of strings, as in
@hosts = string_glob_permute( "host{dev,stag,prod}" );
you'll get permutations with each of the alternatives back: ("hostdev", "hoststag", "hostprod") back.
All of the above can be combined, so
my @hosts = string_glob_permute( "host{dev,stag}[3-4]" );
will result in the permutation ("hostdev3", "hoststag3", "hostdev4", "hoststag4").
The patterns allow numerical ranges only [1-3], no string ranges like [a-z]. Pattern must not contain blanks.
The function returns a list of string permutations on success and "undef" in case of an error. A warning is also issued if the pattern
cannot be recognized.
Zero padding
An expression like
@hosts = string_glob_permute( "host[8-9,10]" );
# ("host8", "host9", "host10")
will expand to ("host8", "host9", "host10"), featuring no zero-padding to create equal-length entries. If you want ("host08", "host09",
"host10"), instead, pad all integers in the range expression accordingly:
@hosts = string_glob_permute( "host[08-09,10]" );
# ("host08", "host09", "host10")
Note on Perl's internal Glob Permutations
Note that there's a little-known feature within Perl itself that does something similar, for example
print "$_
" for < foo{bar,baz} >;
will print
foobar
foobaz
if there is no file in the current directory that matches that pattern. String::Glob::Permute, on the other hand, expands irrespective of
matching files, by simply always returning all possible permutations. It's also worth noting that Perl's internal Glob Permutation does not
support String::Glob::Permute's [m,n] or [m-n] syntax.
COPYRIGHT & LICENSE
Copyright (c) 2008 Yahoo! Inc. All rights reserved. The copyrights to the contents of this file are licensed under the Perl Artistic
License (ver. 15 Aug 1997).
AUTHOR
Algorithm, Code: Rick Reed, Ryan Hamilton, Greg Olszewski. Module: 2008, Mike Schilli <cpan@perlmeister.com>
perl v5.12.4 2009-01-29 Permute(3pm)