Re: isolating text in a string

2008-06-26 Thread Tim Bowden
On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote: > Tim Bowden wrote: > > Hi, > > Hello, > > > I'm trying to isolate text in a string. My string is typically of the > > form: > > sometext["moretext", > > > > I would like to isolate moretext. > > > > I tried: > > #!/usr/bin/perl -w > > my

Why doesn't LWP get html file?

2008-06-26 Thread trymelz
$html has nothing from the following code. Could someone help me? Thanks. use LWP; use URI; $Browser = LWP::UserAgent->new || die "$!"; my $Surfurl = 'http://us.randstad.com/webapp/internet/servlet/ BranchView?b=702'; my @ns_headers = ( 'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT

No Dialog Boxes working

2008-06-26 Thread nuggit
I'm trying to click dialog boxes using Win32::IEAutomation::WinClicker- >new(); I'm having no success in getting this buttons to click in the dialog boxes. Below is the code I'm using. $ie->getButton('caption:', "Add")->Click(1); my $clicker = Win32::IEAutomation::WinClicker->new(

Re: Check if directory is empty on Win32

2008-06-26 Thread Dr.Ruud
Leonid L schreef: > Many of the proposed solutions I've found on Google do not work for > me, perhaps because they assume Unix/Linux host. I need a sub that > will reliably tell me whether a given directory is empty (I am running > Perl on Win XP, NTFS file system). Please give your implementation

Re: parsing a tree like structure

2008-06-26 Thread Brad Baxter
On Jun 26, 9:57 am, [EMAIL PROTECTED] (Pat Rice) wrote: > Hi all > I'm wondering if there is a nice way to parse this data, as in is > there any module that could handle this type of data, as in the was it > is presented? so that I can repeat is itn a tree like structure in > HTML ? > > so I can pi

Re: How can I translate it back to @ sign.

2008-06-26 Thread David Romero
On Thu, Jun 26, 2008 at 4:21 PM, Aruna Goke <[EMAIL PROTECTED]> wrote: > David Romero wrote: >> >> use a regular expression >> >> my $email = 'user!dominio.com'; >> $email =~ s/!/@/g; >> ###Result [EMAIL PROTECTED] >> >> http://www.troubleshooters.com/codecorn/littperl/perlreg.htm >> >> >> On Thu,

Re: How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-06-26 Thread John W. Krahn
Erasmo Perez wrote: Hi dear list: Hello, Thank you very much for you great help in solving my past issue, regarding the removing of the trailing commas and points. Thank you very much indeed :-) Now, my last (I hope) issue. I got another text file in the following format: cluster[1] = { 2

Check if directory is empty on Win32

2008-06-26 Thread Leonid L
Many of the proposed solutions I've found on Google do not work for me, perhaps because they assume Unix/Linux host. I need a sub that will reliably tell me whether a given directory is empty (I am running Perl on Win XP, NTFS file system). Please give your implementation a quick test on a similar

how to click span link in Win32::IEAutomation

2008-06-26 Thread nuggit
Has anyone been able to click a span link, if so how to do it? Source behind my link is: Add Partition is this possible with $ie->getLink? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to remove trailing commas and points from a CSV file ?

2008-06-26 Thread John W. Krahn
Erasmo Perez wrote: Hi dear list: Hello, Please forgive my lack of Perl credentials, but i am a complete beginner But, and that is the problem, I do have an urgent issue and that's why I came to perl in the very first instance I have a CSV file, which comes in the following format: a,b,.,.

Re: How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-06-26 Thread Dr.Ruud
yitzle schreef: > while ( my $line = <> ) { > $line =~ /cluster\[(\d)+\] = {([\d ]+)}/ or die; > my @vals = split( / +/, "$1 $2" ); > print join(",", @vals) . "\n"; > } Less strict alternative: while (<>) { my @vals = /([0-9]+)/g or die; print join(",", @vals) . "\n";

Parse IRC log

2008-06-26 Thread rara
Hello all, I need to parse IRC logs for IPs. The format would be @ then host followed by either ) or ], some may contain unwanted spaces. If the host is not an IP, I would need to have it converted to an IP. The resulting IPs would then have to be looped through Net::DNSBLLookup, with and

Re: How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-06-26 Thread perez . erasmo
Hi dear Yitzle: Thank you very much for your great help :-) Your perl code works great ! The problem was indeed from my side, since I was over-confident in the (mis)use of blank space (a beginner sin) But now your code works, thank to your helpful replies and I now i got my a... neck covered A

Re: how to implement this with perl

2008-06-26 Thread John W. Krahn
yitzle wrote: On Thu, Jun 26, 2008 at 11:00 AM, Li, Jialin <[EMAIL PROTECTED]> wrote: another way to handle the one line input is to read the whole line at once and then use regex to extract each column __CODE__ #!/usr/bin/perl use strict; use warnings; my $label_file = "label.in"; my $thickne

Re: how to implement this with perl

2008-06-26 Thread John W. Krahn
Li, Jialin wrote: another way to handle the one line input is to read the whole line at once and then use regex to extract each column __CODE__ #!/usr/bin/perl use strict; use warnings; my $label_file = "label.in"; my $thickness_file = "thickness.in"; open my $fp_l, "<", $label_file or die "Ca

Re: How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-06-26 Thread yitzle
On Thu, Jun 26, 2008 at 5:22 PM, <[EMAIL PROTECTED]> wrote: > Hi Yitzle: > > Thank you very much for your suggestion: > > Here is my perl file: clusters.pl > > #! /usr/bin/perl > use warnings; > use strict; > while (my $line = <>) { > $line = ~/cluster\[(\d)+\] = {([\d ]+)}/ or die; > my @vals =

Re: How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-06-26 Thread perez . erasmo
Hi Yitzle: Thank you very much for your suggestion: Here is my perl file: clusters.pl #! /usr/bin/perl use warnings; use strict; while (my $line = <>) { $line = ~/cluster\[(\d)+\] = {([\d ]+)}/ or die; my @vals = split(/+/,"$1 $2"); print join(",",@vals). "\n"; } my input file (clusters.i

Re: How can I translate it back to @ sign.

2008-06-26 Thread Aruna Goke
David Romero wrote: use a regular expression my $email = 'user!dominio.com'; $email =~ s/!/@/g; ###Result [EMAIL PROTECTED] http://www.troubleshooters.com/codecorn/littperl/perlreg.htm On Thu, Jun 26, 2008 at 1:35 PM, Aruna Goke <[EMAIL PROTECTED]> wrote: hi, i have the this log from my sms

Re: How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-06-26 Thread yitzle
On Thu, Jun 26, 2008 at 3:28 PM, Erasmo Perez <[EMAIL PROTECTED]> wrote: > Hi dear list: > > Thank you very much for you great help in solving my past issue, > regarding the removing of the trailing commas and points. > > Thank you very much indeed :-) > > Now, my last (I hope) issue. > > I got ano

Re: parsing a tree like structure

2008-06-26 Thread Dr.Ruud
"Pat Rice" schreef: > I'm wondering if there is a nice way to parse this data, as in is > there any module that could handle this type of data, as in the was it > is presented? so that I can repeat is itn a tree like structure in > HTML ? Maybe you are looking for something like this: #!/usr/bin

How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-06-26 Thread Erasmo Perez
Hi dear list: Thank you very much for you great help in solving my past issue, regarding the removing of the trailing commas and points. Thank you very much indeed :-) Now, my last (I hope) issue. I got another text file in the following format: cluster[1] = { 2 3 4 8 10 14 } cluster[2] = { 25

Re: How can I translate it back to @ sign.

2008-06-26 Thread David Romero
use a regular expression my $email = 'user!dominio.com'; $email =~ s/!/@/g; ###Result [EMAIL PROTECTED] http://www.troubleshooters.com/codecorn/littperl/perlreg.htm On Thu, Jun 26, 2008 at 1:35 PM, Aruna Goke <[EMAIL PROTECTED]> wrote: > > hi, > > i have the this log from my sms gateway, howeve

Re: How to remove trailing commas and points from a CSV file ?

2008-06-26 Thread perez . erasmo
Hi dear Yitzle: Thank you very much for you suggestion about the sustitution of the code, required to treat separately the CSV file (from the perl code). It has worked flawlessly :-) Thank you (all) very much Regards On 26/06/2008, yitzle <[EMAIL PROTECTED]> wrote: > On Thu, Jun 26, 2008 at 1:

How can I translate it back to @ sign.

2008-06-26 Thread Aruna Goke
hi, i have the this log from my sms gateway, however, the inverted exclamation mark was sent from the smsc as @. 2008-06-26 17:22:35 SMS request sender:+2342019122 request: 'maruna¡ontng.com,test,Love my test message' file answer: '' 2008-06-26 17:27:17 Receive SMS [SMSC:caxt] [SVC:] [ACT:]

Re: How to remove trailing commas and points from a CSV file ?

2008-06-26 Thread yitzle
On Thu, Jun 26, 2008 at 1:14 PM, <[EMAIL PROTECTED]> wrote: > Hi dear Jeff: > > Thank you very much for your help > > Yiur script is working flawlessly > > Just another question: > > How could I re-write your script in order to treat the __DATA__ > portion of your code as an external file ? > > I

Re: How to remove trailing commas and points from a CSV file ?

2008-06-26 Thread perez . erasmo
Hi dear Jeff: Thank you very much for your help Yiur script is working flawlessly Just another question: How could I re-write your script in order to treat the __DATA__ portion of your code as an external file ? I happen to have the whole CSV file and I would not want to mix directly with it,

Re: parsing a tree like structure

2008-06-26 Thread yitzle
Sorry for the multiple replies... This code works. Though I think I might be doing something "bad". When I comment out the line: $curNode->{ $nodeName }{ '__PARENT__' } = $curNode; after the loop, %root is an empty hash. I'm not sure why. #!/usr/bin/perl use strict; use warnings; use Data::D

Re: parsing a tree like structure

2008-06-26 Thread yitzle
This code is a start. It needs some playing with, still. #!/usr/bin/perl use strict; use warnings; use Data::Dumper; open my $FH, "< t" or die; my %root = (); my $depth = 0; my $curNode = \%root; while ( my $line = <$FH> ) { chomp $line; $line =~ /^(\s*)/; my $leadingSpace = lengt

Re: parsing a tree like structure

2008-06-26 Thread yitzle
On Thu, Jun 26, 2008 at 9:57 AM, Pat Rice <[EMAIL PROTECTED]> wrote: > Hi all > I'm wondering if there is a nice way to parse this data, as in is > there any module that could handle this type of data, as in the was it > is presented? so that I can repeat is itn a tree like structure in > HTML ? >

Re: how to implement this with perl

2008-06-26 Thread yitzle
On Thu, Jun 26, 2008 at 11:00 AM, Li, Jialin <[EMAIL PROTECTED]> wrote: > another way to handle the one line input is to read the whole line at once > and then use > regex to extract each column > > > __CODE__ > #!/usr/bin/perl > use strict; > use warnings; > my $label_file = "label.in"; > my $thic

Re: How to remove trailing commas and points from a CSV file ?

2008-06-26 Thread Jeff Peng
On Fri, Jun 27, 2008 at 12:26 AM, Erasmo Perez <[EMAIL PROTECTED]> wrote: > > a,b,.,.,.,.,.,.,. > b,c,d,.,.,.,.,.,. > e,f,g,h,.,.,.,.,. > i,j,k,l,m,.,.,.,. > > and so on > > My problem: how could I get rid of the trailing points and commas, so > the output CSV file could get following neat format

How to remove trailing commas and points from a CSV file ?

2008-06-26 Thread Erasmo Perez
Hi dear list: Please forgive my lack of Perl credentials, but i am a complete beginner But, and that is the problem, I do have an urgent issue and that's why I came to perl in the very first instance I have a CSV file, which comes in the following format: a,b,.,.,.,.,.,.,. b,c,d,.,.,.,.,.,. e,f

Re: parsing a tree like structure

2008-06-26 Thread Jeff Peng
On Thu, Jun 26, 2008 at 11:53 PM, Jeff Peng <[EMAIL PROTECTED]> wrote: > On Thu, Jun 26, 2008 at 9:57 PM, Pat Rice <[EMAIL PROTECTED]> wrote: >> >> \==+Interface : >>|Link State.Down >> \==+SCSI Interface : > > Is this the info in

Re: parsing a tree like structure

2008-06-26 Thread Jeff Peng
On Thu, Jun 26, 2008 at 9:57 PM, Pat Rice <[EMAIL PROTECTED]> wrote: > > \==+Interface : >|Link State.Down > \==+SCSI Interface : Is this the info in a text file? If so I think you must parse it by hand, after that you create the

Re: how to implement this with perl

2008-06-26 Thread John W. Krahn
vikingy wrote: Hi all, Hello, I have two files,one is label file,another is thickness file, they are one to one correspondence, for example: the label file is : 2 2 3 2 1 3 4 5 2 5 1 4 .. the thickness file is:0.3 0.8

Re: how to implement this with perl

2008-06-26 Thread Li, Jialin
On Thu, Jun 26, 2008 at 9:42 AM, yitzle <[EMAIL PROTECTED]> wrote: > On Thu, Jun 26, 2008 at 8:18 AM, vikingy <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I have two files,one is label file,another is thickness file, they are > one to one correspondence, for example: > > the label file is :

Re: how to implement this with perl

2008-06-26 Thread yitzle
On Thu, Jun 26, 2008 at 8:18 AM, vikingy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have two files,one is label file,another is thickness file, they are one > to one correspondence, for example: > the label file is : 2 2 3 2 1 3 4 5 >2 5 1

not able to install Digest::SHA

2008-06-26 Thread Noah
Hi there, I have a new ubuntu installed on my machine and I cannot seem to build the Digest::SHA module. What am I doing wrong? here are the shell commands with failed output from the Perl CLI. [EMAIL PROTECTED]:/home/noah# perl -MCPAN -e shell | tee SHA.txt CPAN: File::HomeDir loaded ok (v

parsing a tree like structure

2008-06-26 Thread Pat Rice
Hi all I'm wondering if there is a nice way to parse this data, as in is there any module that could handle this type of data, as in the was it is presented? so that I can repeat is itn a tree like structure in HTML ? so I can pic out the tree like structure and replicate it in some way so that I

Re: use of uninitialized value in subroutine entry at ~~ line 12

2008-06-26 Thread John W. Krahn
koonom wrote: #!/usr/bin/perl -w use LWP::Simple; use HTML::LinkExtor; $URL = get("http//www.nytimes.com"); #open (FILE, ">file.txt"); $LinkExtor = HTML::LinkExtor->new(\&link); Jeff already pointed out your error here^^. $LinkExtor->parse($URL); sub links { ($tag, %links) = @_;

how to implement this with perl

2008-06-26 Thread vikingy
Hi all, I have two files,one is label file,another is thickness file, they are one to one correspondence, for example: the label file is : 2 2 3 2 1 3 4 5 2 5 1 4 .. the thickness file is:0.3 0.8 0.2 0.1 2.4 0.9 3

Re: use of uninitialized value in subroutine entry at ~~ line 12

2008-06-26 Thread Jeff Peng
new(\&link); which should be: new(\&links); Please add "use strict" at the top of the script. On Thu, Jun 26, 2008 at 2:06 PM, koonom <[EMAIL PROTECTED]> wrote: > and then comes the error:use of uninitialized value in subroutine > entry at ~~ line 12 > what does it mean actually? -- Jeff Pe

use of uninitialized value in subroutine entry at ~~ line 12

2008-06-26 Thread koonom
#!/usr/bin/perl -w use LWP::Simple; use HTML::LinkExtor; $URL = get("http//www.nytimes.com"); #open (FILE, ">file.txt"); $LinkExtor = HTML::LinkExtor->new(\&link); $LinkExtor->parse($URL); sub links { ($tag, %links) = @_; if ($tag eq "a"){ foreach $key (keys %links){

search.bat: find, write to a file, highlight the found text

2008-06-26 Thread bdy120602
Hello. I'm using this script below to grab single pages from a site. I then parse the file, stripping the HTML, leaving plain text, which writes to that file. use strict; use HTML::Stripper; use LWP::Simple qw( get ); my $stripper = HTML::Stripper->new(skip_cdata => 1, strip_ws => 0