Take a look a WWW::Mechanize. The older web suite LWP is an
alternative and that may be enough if you only need a specific
item. LWP::Simple is a possibility to see if you can mine the info
from the page. If there's more complexity, then LWP::UserAgent
is a starting point.
A couple of books too:
On Tue, 31 Jan 2017 17:29:10 +0530
Uday Vernekar wrote:
> Thanks shlomi ,working on your inputs...Thanks:)
>
You're welcome, Uday!
--
-
Shlomi Fish http://www.shlomifish.org/
http://www.shlomifish.org/humour/bits/facts/Emma
Hi Uday,
see my reply interim with your code.
On Tue, 31 Jan 2017 15:31:59 +0530
Uday Vernekar wrote:
> Requirement:
>
> I have Test log files with filename as SerialNumber of tested Product and
> the log file consist of
> below data and other Text.the IP addresses can be repeated need to fet
Thanks shlomi ,working on your inputs...Thanks:)
On Tue, Jan 31, 2017 at 4:34 PM, Shlomi Fish wrote:
> Hi Uday,
>
> see my reply interim with your code.
>
> On Tue, 31 Jan 2017 15:31:59 +0530
> Uday Vernekar wrote:
>
> > Requirement:
> >
> > I have Test log files with filename as SerialNumber o
Thanks for quick lesson and pro-tips. I'll be sure to implement some of
these.
In case you were wondering, I am indeed using strict and warnings.
diagnostics, too.
Thanks again.
On 1/18/15 9:05 PM, Brandon McCaig wrote:
Mike:
On Sun, Jan 18, 2015 at 07:00:05PM -0500, Mike wrote:
So I've g
Mike:
On Sun, Jan 18, 2015 at 07:00:05PM -0500, Mike wrote:
> So I've got a text file in a multi column format (three
> columns), each column is separated by a single space. Here is a
> snippet for reference:
>
> artless base-court apple-john
> bawdy bat-fowling baggage
> beslubbering beef-witted
On Sun, Jan 18, 2015 at 07:24:21PM -0500, Shawn H Corey wrote:
> my @line = (
> @first[rand(@first)],
> @second[rand(@second)],
> @third[rand(@third)],
>);
Sorry to beat on you, Shawn, but I missed this the first time
around. T
On Sun, Jan 18, 2015 at 4:00 PM, Mike wrote:
> So I've got a text file in a multi column format (three columns), each
> column is separated by a single space. Here is a snippet for reference:
>
> artless base-court apple-john
> bawdy bat-fowling baggage
> beslubbering beef-witted barnacle
>
> I wa
Thanks. I'll give this a shot.
On 1/18/15 7:44 PM, Brandon McCaig wrote:
On Sun, Jan 18, 2015 at 07:24:21PM -0500, Shawn H Corey wrote:
You would need an array for each column:
my $MAX = 10;
my @first = ();
my @second = ();
my @third = ();
sub get_columns {
my $file = shift @_;
o
On Sun, Jan 18, 2015 at 07:24:21PM -0500, Shawn H Corey wrote:
> You would need an array for each column:
>
> my $MAX = 10;
>
> my @first = ();
> my @second = ();
> my @third = ();
>
> sub get_columns {
> my $file = shift @_;
>
> open my $fh, '<', $file or die "could not open $file: $!\
On Sun, 18 Jan 2015 19:00:05 -0500
Mike wrote:
> sub gen_ins {
> open(FH, '<', 'insults2.txt') or die "[-] ERROR: Can't find
> insult list.";
> my @cols = split (" ", );
> print "$cols[0]";
> close FH;
> }
>
> gen_ins();
>
> When currently run, gen_ins() will print out the f
On 16/12/2014 20:05, Kenneth Wolcott wrote:
> Hi;
>
> I've got some strings that I need to parse the value(s) off of the key.
>
> The key is (possibly) space-separated and terminate by a colon, and
> the value is delimited by single quotes. But there are (potentially)
> additional values for
On Tue, Dec 16, 2014 at 4:29 PM, Kenneth Wolcott
wrote:
> Well, I had to look at
> http://perldoc.perl.org/perlrequick.html#Extracting-matches to find
> out how much I had forgotten about extracting matches from a regex :-)
>
> This might be inefficient, but it seems to work:
>
> $shared_folder =~
On Tue, Dec 16, 2014 at 12:18 PM, Tiago Hori wrote:
> Have you tried Text::CSV_XS? It allows you to set both the separatist and eol
> and it also lets you use complex separators.
>
> T.
>
> Sent from my iPhone
>
>> On Dec 16, 2014, at 4:05 PM, Kenneth Wolcott
>> wrote:
>>
>> Hi;
>>
>> I've got
Have you tried Text::CSV_XS? It allows you to set both the separatist and eol
and it also lets you use complex separators.
T.
Sent from my iPhone
> On Dec 16, 2014, at 4:05 PM, Kenneth Wolcott wrote:
>
> Hi;
>
> I've got some strings that I need to parse the value(s) off of the key.
>
> T
On 08/08/2013 18:18, David Precious wrote:
On Thu, 8 Aug 2013 22:42:01 +0530
Unknown User wrote:
What would be the best module available for parsing html in your
opinion? My intention is to parse html that contains a table of 5
columns and any number of rows
For parsing HTML tables, you want
On Thu, Aug 8, 2013 at 10:18 AM, David Precious wrote:
> On Thu, 8 Aug 2013 22:42:01 +0530
> Unknown User wrote:
>
> > What would be the best module available for parsing html in your
> > opinion? My intention is to parse html that contains a table of 5
> > columns and any number of rows
>
> For
On 8 Aug 2013 18:19, "Unknown User" wrote:
>
>
> What would be the best module available for parsing html in your opinion?
I would also say look at HTML::TreeBuilder
> My intention is to parse html that contains a table of 5 columns and any
number of rows, and have a hash ref like
> $html->{1}->
Have a look at HTML::PARSER.
On Aug 8, 2013 10:50 PM, "Unknown User" wrote:
>
> What would be the best module available for parsing html in your opinion?
> My intention is to parse html that contains a table of 5 columns and any
> number of rows, and have a hash ref like
> $html->{1}->{col1}=data
On Thu, 8 Aug 2013 22:42:01 +0530
Unknown User wrote:
> What would be the best module available for parsing html in your
> opinion? My intention is to parse html that contains a table of 5
> columns and any number of rows
For parsing HTML tables, you want HTML::TableExtract, IMO.
https://metacp
(a) Your subject line doesn't seem to have anything to do with the
question in your message.
(b) The documentation for Mail::IMAPClient says that the search()
method arguments are appended to an IMAP SEARCH command. I think if
you look at the relevent section of the IMAP RFC
(https://tools.ietf.or
Thanks Michael!! Between you and Rob, I have been able to transfer my
contacts from my old cell phone to a text file on a local machine and then
upload them to my database. It is a shame to have a cell company not
provide a better service during an phone upgrade. You guys have helped me
come up wit
Okay, enough. This thread derail ends now. Shlomi, Rob, if you feel
you need to continue this discussion in front of witnesses, feel free
to continue CCing me on your private discussion -- but leave
perl-beginners out of it.
This type of nitpicking and sniping back and forth does not foster a
welc
On 23/07/2013 19:00, Shlomi Fish wrote:
Why do you feel that I've been "promoting" XML::LibXML in this thread?
Because you say
Instead one should use [XML::LibXML]
I call that promotion.
Why does the fact that I'm affiliated with it, prevent me from
recommending it over a different alter
Hi Rob,
On Tue, 23 Jul 2013 18:15:07 +0100
Rob Dixon wrote:
> On 23/07/2013 14:39, Shlomi Fish wrote:
> > Hi Rob,
> >
> > I recommend against using XML::XPath because it's been undermaintained, is
> > slower than XML::LibXML's XPath support, may be more incomplete and I
> > believe it has poorer
On 23/07/2013 14:39, Shlomi Fish wrote:
Hi Rob,
I recommend against using XML::XPath because it's been undermaintained, is
slower than XML::LibXML's XPath support, may be more incomplete and I believe
it has poorer support for XML namespaces.
Instead one should use https://metacpan.org/module/X
Hi Rob,
On Mon, 22 Jul 2013 21:48:33 +0100
Rob Dixon wrote:
> On 22/07/2013 10:55, Omega -1911 wrote:
> >
> > Hello all - I am working on a small address book conversion where I need
> > to convert a text file in where I dumped the addresses and post them to
> > my database/website using the Mec
On 07/23/2013 11:08 AM, Omega -1911 wrote:
Rob - Thanks for the tip. I am not familiar with the module (XML::XPath)
but tried to play with the code a little more to also retain the URL as
well but was not successful. What would I need to modify or add to do
this? After a 14 hour work day, I wo
On Mon, Jul 22, 2013 at 4:55 AM, Omega -1911 <1911...@gmail.com> wrote:
> Can anyone shed some light and point me in the right direction?
Specifically, your REs are failing because there is a space in the data
after the close quote for the class attribute that your REs don't have.
This a good ex
On 02/26/13 10:46, Noah wrote:
I want to parse text from a website. what are some good methods and
modules to do this? Any tutorial links?
"Perl & LWP" is the canonical book on the subject:
http://shop.oreilly.com/product/9780596001780.do
HTH,
David
--
To unsubscribe, e-mail: begin
On Feb 26, 2013, at 10:46 AM, Noah wrote:
> Hi there,
>
> I want to parse text from a website. what are some good methods and modules
> to do this? Any tutorial links?
I am currently using LWP::UserAgent to scrape some websites and
HTML::TokeParser and HTML::TableExtract to extract links an
On 2/26/2013 1:46 PM, Noah wrote:
Hi there,
I want to parse text from a website. what are some good methods and
modules to do this? Any tutorial links?
Cheers
WWW::Mechanize
http://search.cpan.org/dist/WWW-Mechanize/lib/WWW/Mechanize.pm
--
To unsubscribe, e-mail: beginners-unsubscr...@
On Mon, Sep 10, 2012 at 02:45:20PM -0500, Andy Bach wrote:
> On Mon, Sep 10, 2012 at 7:12 AM, Danny Gratzer
> wrote:
> > while (){
> > my ($logindate, $dbserver, $hostname, $status ) = split (/,/);
> > $info{$username} = {$logindate=>[$dbserver, $hostname, $status]};
> > }
>
> One thing to w
On Mon, Sep 10, 2012 at 5:14 PM, andrew sison wrote:
> Hi,
>
> I'm confronted with this problem.I've done this before but I just
> can't remember how.
>
> There is a log file I am trying to parse:
>
> open FILE , 'C:\test.csv' or die $!;
>
Use below method to open the file , $file now contain fil
On Mon, Sep 10, 2012 at 7:12 AM, Danny Gratzer wrote:
> while (){
> my ($logindate, $dbserver, $hostname, $status ) = split (/,/);
> $info{$username} = {$logindate=>[$dbserver, $hostname, $status]};
> }
One thing to watch for - logins on the same day will overwrite here, so
while (){
my
On 10 Sep 2012 13:44:20 -
Peter Scott wrote:
> On Mon, 10 Sep 2012 20:52:41 +0800, andrew sison wrote:
> > I don't get how you can actually print the contents of the subhash.
>
> Generic hash-of-hashes iteration example:
>
> for my $outer_key ( keys %hash )
> {
> print "Outer key: $outer_
On Mon, 10 Sep 2012 20:52:41 +0800, andrew sison wrote:
> I don't get how you can actually print the contents of the subhash.
Generic hash-of-hashes iteration example:
for my $outer_key ( keys %hash )
{
print "Outer key: $outer_key:\n";
for my $inner_key ( sort keys %{ $hash{$outer_key} } )
I don't get how you can actually print the contents of the subhash.
foreach my $user(keys %info){
print $info{$user}; #This gives me hash
print $user, "\n"#Here I can retrieve the usernames that
were made hash keys
}
Now here is where I hit a dead e
I would create a hash with hash references containing the date and
an anonymous array as members. Something like this:
open FILE , 'C:\test.csv' or die $!;
my %info
while (){
my ($logindate, $dbserver, $hostname, $status ) = split (/,/);
$info{$username} = {$logindate=>[$dbserver, $hostname, $
You want something like this:
#!/software/bin/perl
use warnings;
use strict;
my $file = "example.txt";
open my $in, '<', $file or die "Cannot open '$file' because: $!";
while ( <$in> ) {
next if /^#/;
chomp;
my ( $key, @fields ) = split /\t/;
print map "$key\t$_\n", @fields;
thanks a lot Rob
I would like an output without the $VAR...
so I did add this after the push function and it is perfect, thanks a
lot again
foreach my $number(@othernumbers){print $rownum,"\t",$elet, "\n";}
#!/usr/local/bin/perl
use strict;
use warnings;
my $fh;
my %results;
open ( $fh,
nathalie wrote:
Hi
Hello,
I have this format of file: (see attached example)
1 3206102-3207048 3411782-3411981 3660632-3661428
2 4481796-4482748 4483180-4483486
and I would like to change it to this
1 3206102-3207048
1 3411782-3411981
1 3660632-3661428
2 4481796-4482748
2 4483180-4483486
On Thu, May 31, 2012 at 11:37 AM, nathalie wrote:
>
>
> Hi
> I have this format of file: (see attached example)
> 1 3206102-3207048 3411782-3411981 3660632-3661428
> 2 4481796-4482748 4483180-4483486
>
>
> and I would like to change it to this
> 1 3206102-3207048
> 1 34117
In addition to what Shlomi has mentioned, I will add:
On May 3, 2012, at 4:34 AM, venkates wrote:
> sub parse {
>
>my $pazar_file_path = shift;
>my $pazar_data; # ref to a hash holding the parsed data
>
>open FH, '<', $pazar_file_path or croak ( "Cannot open file
> '$pazar_file_pat
Hi Aravind,
On Thu, 03 May 2012 13:34:35 +0200
venkates wrote:
> Hi all,
>
> I am trying to parse a tab-delimited file which has repeating lines.
> This is causing problems while parsing it to the data structure (see
> below). I would appreciate if you could help me solve this.
>
If your f
Thanks everyone for the great ideas. After I implemented the
solution(s) you guys proposed I stumbled upon Nagios::Object
(http://search.cpan.org/~duncs/Nagios-Object-0.21.16/). I did learn a
few things from your ideas though so I am grateful none the less!
I recommend anyone working with Na
On 31/01/2012 22:43, Brandon Phelps wrote:
Hello all,
I am attempting to parse a Nagios status.dat file and am curious about
what the most efficient way to do this would be. I'm sure I could come
up with something but it would be very convoluted and I'm sure there is
a better way. Below is a sam
February 01, 2012 2:11 PM
To: jbiskofski
Cc: Brandon Phelps; beginners@perl.org
Subject: Re: Parsing Question
Hi jbiskofski,
This script will not work WHY? -- Scalar found where operator expected
at . [ Please Check ] line 72, near "$we_are_inside_hoststatus_block"
..
This commun
ah - i get it now.
thanks.
On Wed, Feb 1, 2012 at 3:05 PM, Jim Gibson wrote:
> On 2/1/12 Wed Feb 1, 2012 11:24 AM, "jbiskofski"
> scribbled:
>
> > Your comment about the open statement is OK. I guess it really comes down
> > to style. I was trying to write something clear that Brandon could
On 2/1/12 Wed Feb 1, 2012 11:24 AM, "jbiskofski"
scribbled:
> Your comment about the open statement is OK. I guess it really comes down
> to style. I was trying to write something clear that Brandon could improve
> upon.
It is not simply a matter of style. Because of operator precedence, the
s
Timothy
Could it be that when you copy pasted the script the line wrap got messed
up? It works fine for me.
Im using perl 5.12.3
Your comment about the open statement is OK. I guess it really comes down
to style. I was trying to write something clear that Brandon could improve
upon.
Here is a p
Hi jbiskofski,
This script will not work WHY? -- Scalar found where operator expected
at . [ Please Check ] line 72, near "$we_are_inside_hoststatus_block"
..
On Wed, Feb 1, 2012 at 6:38 PM, jbiskofski wrote:
> Hey Brandon
>
> Here is a solution to this problem. It is purposely r
Hey Brandon
Here is a solution to this problem. It is purposely really long. It takes
the simplest most understandable solution.
If you have questions about it let me know.
#!/usr/local/bin/perl
# always a good idea, forces scope to if/for/foreach/while blocks
use strict;
# open the file, int
Just my $0.02... can't help offering a slight rewrite of David's great
program.
Now it's runnable on 5.010 and earlier, and should give out some warnings
if hoststatus sections are somehow corrupt:
$|++; # comment it out if you don't need to buffer the output
my $section_started;
my ($host, $state
Brandon,
I took most of your comments and sample data and put it in the following
program. Taking the data out of the program and parsing it from files and
directories, might be a good exercise for you. Generally variables are best
declared close to where they are first used. Since the scope of
Thanks a ton David,
This will definitely help! Not able to try it now but I'll give it a
shot first thing tomorrow.
-Brandon
On 1/31/2012 8:15 PM, Kronheim, David (Contr) wrote:
Brandon,
I took most of your comments and sample data and put it in the following
program. Taking the data out
Steve Bertrand wrote:
On 2012.01.26 12:59, Chris Stinemetz wrote:
#!/usr/bin/perl
use warnings;
use strict;
while ( ) {
chomp;
my @array = split;
my $GeneID = $array[6];
if ($GeneID =~ /^C|D/) {
print $_,"\n";
}
}
__DATA__
Line1 c 2 3 4 5 C 7 8 9
Line2 1 2 3 4 5 6 7 8 9
Line3 1 2 3 4 5 D 7 8
Chris Stinemetz wrote:
***tested***
#!/usr/bin/perl
use warnings;
use strict;
while ( ) {
chomp;
my @array = split;
my $GeneID = $array[6];
if ($GeneID =~ /^C|D/) {
I'm still learning regex but it could be better written with;
if ($GeneID =~ /^[CD]/) {
Plus they do two different t
On 2012.01.26 12:59, Chris Stinemetz wrote:
Hello Tiago,
On Thu, Jan 26, 2012 at 11:08 AM, Tiago Hori wrote:
Hi All,
I need some help to get started on a script.
I have these huge data files 16K rows and several columns. I need to parse
the rows into a subset of these 16K rows. Each rows has
Thanks Chris!
I am going to give this a go now!
Cheers,
T.
On Thu, Jan 26, 2012 at 2:40 PM, Chris Stinemetz
wrote:
> > ***tested***
> >
> > #!/usr/bin/perl
> > use warnings;
> > use strict;
> >
> > while ( ) {
> > chomp;
> > my @array = split;
> > my $GeneID = $array[6];
> >
> > if ($Ge
> ***tested***
>
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> while ( ) {
> chomp;
> my @array = split;
> my $GeneID = $array[6];
>
> if ($GeneID =~ /^C|D/) {
I'm still learning regex but it could be better written with;
if ($GeneID =~ /^[CD]/) {
--
To unsubscribe, e-mail: beginners-u
Hello Tiago,
On Thu, Jan 26, 2012 at 11:08 AM, Tiago Hori wrote:
> Hi All,
>
> I need some help to get started on a script.
>
> I have these huge data files 16K rows and several columns. I need to parse
> the rows into a subset of these 16K rows. Each rows has a identifier made
> up of 2 letters
> -Original Message-
> From: Chris Stinemetz [mailto:chrisstinem...@gmail.com]
> Sent: Wednesday, December 21, 2011 11:18 AM
> To: Binish A.R
> Cc: John W. Krahn; Perl Beginners
> Subject: Re: parsing data
>
> I'm trying to implement the advice that Bin
I'm trying to implement the advice that Binish, and John gave.
I am getting the following error:
Can't use an undefined value as a HASH reference at ./format.pl line
16, line 2.
Any help is greatly appreciated,
Chris
#!/usr/bin/perl
use warnings;
use strict;
my $csno;
while( ) {
chomp;
catch
From: John W. Krahn
To: Perl Beginners
Sent: Wednesday, December 21, 2011 12:25 PM
Subject: Re: parsing data
Binish A.R wrote:
> If you can guarantee the order in which the keys appear, you may not have to
> build a hash to hold the entire data.
&
Binish A.R wrote:
If you can guarantee the order in which the keys appear, you may not have to
build a hash to hold the entire data.
Instead you can read block by block and print the result.
--
my $csno;
while (<>) {
chomp;
s/^\s+//g; s/\s+$//g; ### weed out all w
If you can guarantee the order in which the keys appear, you may not have to
build a hash to hold the entire data.
Instead you can read block by block and print the result.
--
my $csno;
while (<>) {
chomp;
s/^\s+//g; s/\s+$//g; ### weed out all whitespaces
On 12/20/2011 05:16 PM, Chris Stinemetz wrote:
I am having some trouble coming up with a solution for what I am
trying to accomplish.
Any advice is greatly appreciated.
...
*** input ***
csno=1
rfpi=1
vrp0=3423000
vrp1=3423000
trl=170
line=
low=
high=5
csno=1
rfpi=2
vrp0=3423000
vrp1=
On 21/10/2011 19:16, Brandon McCaig wrote:
Thanks for the explanation, Rob. :)
use strict;
use warnings;
use v5.010;
my $data = 'aaa bbb ccc';
say $data;
for my $pattern (qw(bbb aaa ccc))
{
say join ' ', pos($data) // 'undef', $pattern,
scalar $data =~ /$pattern/g;
}
__EN
On Fri, Oct 21, 2011 at 1:52 PM, Rob Dixon wrote:
> It is nothing to do with matched patterns overlapping. As I tried to
> describe, it is the designed behaviour of m//g in scalar context to find
> just one match, searching from the end of the previous match if it was
> successful, or restarting f
On 21/10/2011 16:32, Jim Gibson wrote:
>
> I ran the provided program and was going to say that the /g modifier is
> unnecessary. I took it out and noticed that the results differed. I
> believe the difference is that some of the matched patterns overlap, and
> whether or not you want to count
At 11:55 AM +0100 10/21/11, Rob Dixon wrote:
On 21/10/2011 11:31, Nathalie Conte wrote:
HI Rob,
Hello Nat
Please keep your replies to the Perl beginners list, so that other
people can both help and learn from the discussion.
(It would also help if you could bottom-post your replies (put the
Rob Dixon wrote:
On 21/10/2011 00:32, nac wrote:
I have corrected myself a bit, I think the script is now giving me what I
want, having said that, I guess it is not the best way ( even if there is
more than one way), again any pointer are welcome.
many thanks
Nat
#!/usr/bin/perl
use strict;
Rob Dixon wrote:
On 21/10/2011 11:31, Nathalie Conte wrote:
HI Rob,
Hello Nat
Please keep your replies to the Perl beginners list, so that other
people can both help and learn from the discussion.
(It would also help if you could bottom-post your replies (put the
response after the text you
On 21/10/2011 11:31, Nathalie Conte wrote:
HI Rob,
Hello Nat
Please keep your replies to the Perl beginners list, so that other
people can both help and learn from the discussion.
(It would also help if you could bottom-post your replies (put the
response after the text you are quoting). It i
On 21/10/2011 00:32, nac wrote:
> HI again,
> I have corrected myself a bit, I think the script is now giving me what I
> want, having said that, I guess it is not the best way ( even if there is
> more than one way), again any pointer are welcome.
> many thanks
> Nat
Hi Nat
> #!/usr/bin/perl
> u
On 21/10/2011 02:50, John W. Krahn wrote:
nac wrote:
HI again,
Hello,
I have corrected myself a bit, I think the script is now giving me what I
want, having said that, I guess it is not the best way ( even if there is
more than one way), again any pointer are welcome.
many thanks
Nat
#!/usr/
nac wrote:
HI again,
Hello,
I have corrected myself a bit, I think the script is now giving me what I
want, having said that, I guess it is not the best way ( even if there is
more than one way), again any pointer are welcome.
many thanks
Nat
#!/usr/bin/perl
use strict;
use warnings;
my @seq;
On 21/10/2011 00:32, nac wrote:
> HI again,
> I have corrected myself a bit, I think the script is now giving me what I
> want, having said that, I guess it is not the best way ( even if there is
> more than one way), again any pointer are welcome.
> many thanks
> Nat
> #!/usr/bin/perl
> use strict
nac wrote:
HI,
Hello,
I need your wisdom on this parsing script. I have a fastq file,this
contains info for reads ( from nextGen), 1 line starts with a @, second
contain the sequence info from which I want to count pattern, third line
with a sign, fourth with info about the sequence quality (
HI again,
I have corrected myself a bit, I think the script is now giving me what I
want, having said that, I guess it is not the best way ( even if there is
more than one way), again any pointer are welcome.
many thanks
Nat
#!/usr/bin/perl
use strict;
use warnings;
my @seq;
@seq=qw{^TGGCAGTGGAGG
John W. Krahn wrote:
Mariano Loza Coll wrote:
Hi John,
Hello,
I'm trying to learn a little bit more of Perl everyday, and I was
intrigued about your earlier suggestion in a thread.
my $bad_chromosomes = qr/^(?:6|8|14|16|18|Y)\t/;
while (<$IN> ) {
print $OUT $_ if !/$bad_chromosomes/
Mariano Loza Coll wrote:
Hi John,
Hello,
I'm trying to learn a little bit more of Perl everyday, and I was
intrigued about your earlier suggestion in a thread.
my $bad_chromosomes = qr/^(?:6|8|14|16|18|Y)\t/;
while (<$IN> ) {
print $OUT $_ if !/$bad_chromosomes/;
}
I get the s
Nathalie Conte wrote:
Hi,
Hello,
I am lost in my script, and would need to basic help please.
I have got a file , separated by tabs, and the first column contain a
chromosome number, then several other column with different infos.
Basically I am trying to created a script that would take a f
> From: Nathalie Conte [mailto:n...@sanger.ac.uk]
> Sent: Friday, September 30, 2011 9:38 AM
> To: beginners@perl.org
> Subject: parsing script removing some lines help please
>
>
>
> Hi,
> I am lost in my script, and would need to basic help please.
> I have got a file , separated by tabs, and
On Fri, Sep 30, 2011 at 09:37, Nathalie Conte wrote:
> thanks for any clues
It's a simple one, really.. 8^)
> #!/software/bin/perl
> use warnings;
> use strict;
> open(IN, " open(OUT, ">>removed.txt") or die( $! );
ObCorrectness: you should say something more like
open( my $IN , '<' , 'example
er.
From: Rob Dixon
To: Perl Beginners
Cc: Rajeev Prasad
Sent: Saturday, September 3, 2011 4:13 AM
Subject: Re: parsing and adding back this string
On 02/09/2011 23:33, Rajeev Prasad wrote:
> friends,
>
> I am now trying to parse this string in this way...
>
> x= could be a
On 02/09/2011 23:33, Rajeev Prasad wrote:
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x
string0=ABC
string2="x,x,x"
string3="x,x"
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
On Fri, Sep 2, 2011 at 6:54 PM, Rob Dixon wrote:
> I'm afraid your post doesn't make very much sense to me, and doesn't
> contain a question. Can you give an example showing what you want from
> some real data?
Agreed. As you describe, "x" can be anything, yet your sample is full
of x's all over
On 02/09/2011 23:33, Rajeev Prasad wrote:
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,"x,x,x",x,x,x,"x,x",x
string0=ABC
string2="x,x,x"
string3="x,x"
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
On 06/08/2011 15:14, Emeka wrote:
John,
Thanks for making things pretty simple for mere mortals ..
Hi Emeka
chomp( my $raw_file = glob "@ARGV" );
I am of the view that glob sub is used for as tree (that is to get all the
files in a folder and all its sub-folders. From the above, it see
John,
Thanks for making things pretty simple for mere mortals ..
>>
> chomp( my $raw_file = glob "@ARGV" );
>
I am of the view that glob sub is used for as tree (that is to get all the
files in a folder and all its sub-folders. From the above, it seems like it
could be used for something else.
> "ta" == timothy adigun <2teezp...@gmail.com> writes:
ta> I believe you know that in Perl there are more than one way to do
ta> it! i.e solve a problem. And that one way is no better than the
ta> other, it only depend on what the programmer preferred to use, as
ta> long as the syntax
Hi John,
I believe you know that in Perl there are more than one way to do it! i.e
solve a problem. And that one way is no better than the other, it only
depend on what the programmer preferred to use, as long as the syntax are
correct.
Secondly, most of your why would have been answered, if only y
timothy adigun wrote:
Hi Ryan,
Try the the code below, it should help.
===
#!/usr/bin/perl -w
use strict;
my $ln="";
my ($yr,$cat,$win)=("","","");
my $filename="New_output.txt";
chomp(my $raw_file=<@ARGV>);
That is the same as saying:
chomp( my $raw_file = glob
Timothy,
That worked like a charm. Thank you so much for the help.
-Ryan
On Thu, Aug 4, 2011 at 4:41 AM, timothy adigun <2teezp...@gmail.com> wrote:
> Hi Ryan,
> Try the the code below, it should help.
>
> ===
>
> #!/usr/bin/perl -w
> use strict;
>
> my $ln="";
> my ($yr,
Hi Ryan,
Try the the code below, it should help.
===
#!/usr/bin/perl -w
use strict;
my $ln="";
my ($yr,$cat,$win)=("","","");
my $filename="New_output.txt";
chomp(my $raw_file=<@ARGV>);
open READFILE,"<","$raw_file" or die "can't open $!";
open OUTPUTFILE,">","$filenam
Rob Dixon wrote:
After these changes, the loop looks like this
while (){
chomp;
my @line=split(/\t/);
if ($line[3] == -1) {
print OUT "$_\n";
}
}
You can make it much simpler than that:
while ( ) {
print OUT if /\t-1$/;
}
John
--
Any intelligent fool can make
Hi Nathalie,
On Thu, 21 Jul 2011 12:00:57 +0100
Nathalie Conte wrote:
> HI,
> I want to create a simple script where I am parsing a file and writing
> only the lines where I can find a certain value in a new output file
> this is my Infile format: workable example attached
> I want to keep only
On 21/07/2011 12:00, Nathalie Conte wrote:
HI,
I want to create a simple script where I am parsing a file and writing
only the lines where I can find a certain value in a new output file
this is my Infile format: workable example attached
I want to keep only the lines where there is a 1 not the o
1 - 100 of 582 matches
Mail list logo