extracting

2003-02-04 Thread mario kulka
Hi, While uploading a file my $type outputs as "audio/mpeg" What's the simplest way to extract just the extension (in this case mpeg)? I thought to do this: ($not_needed,$extension) = split; But can $type = $info->{'Content-Type'} output something in other formats with more elements? (e.g. audio

extracting substr

2001-06-09 Thread William
hi, i want to be able to read a text file and extract only the valid ip addresses. however, along with valid ip addresses my code is grabbing "periods" and invalid ip addresses, e.g., .xxx, www.xxx.yyy . how can i correct this? = while () { chomp; if (($L) = ($_) =~ m/\b([0-9.0-9.0-9.0

RE: extracting

2003-02-04 Thread Bob Showalter
mario kulka wrote: > Hi, > While uploading a file my $type outputs as "audio/mpeg" > What's the simplest way to extract just the extension (in this case > mpeg)? Properly speaking, that's not an extension, but rather a "subtype". RFC 2045 gives you all the gory details on extactly how Content-typ

RE: extracting

2003-02-04 Thread mario kulka
Thanks for all the info. Basically what I'm trying to acomplish is to somehow get the extansion of the file so after renaming it I know what extension (subtype) I should assign to it. How people usually do that? Would extracting the subtype from the path (the file name) be a good idea? I

extracting text

2002-07-03 Thread Charlie Farinella
I have the following script that prints email addresses enclosed in <> from a logfile. It works by removing everything up to and including the bracket on the left, and then doing the same on the right. I would like to be able to just extract the text between the brackets. I have been unable to

extracting text

2003-08-04 Thread Bryan Irvine
I'm trying to build a script to automagically black-list spammers. How can I extract the ip address from between [ ]? turn this: Received: from 24.60.195.149 (h00a0cce008a4.ne.client2.attbi.com [24.60.195.149]) Received: from 11.139.74.233 ([11.139.74.233]) by n7.groups.yahoo.com with NNFMP; M

extracting coordinates

2005-05-09 Thread Aditi Gupta
Hi everyone, That code is working... But my specific problem is as follows: i have a file in which data is stored as HELIX 4 4 VAL 74 LEU 84 1 11 CRYST1 33.020 33.750 75.670 90.00 90.00 90.00 P 21 21 21 4 ORIGX1 1.00 0.00 0.00 0.0 ORIGX2 0.00 1.00 0.00 0.0 OR

extracting columns

2005-05-17 Thread Aditi Gupta
Hi everybody, to extract data columnwise from a file, the following code was written with the help of perl experts of this list. the script is as follows: #!usr/bin/perl u

Re: extracting substr

2001-06-09 Thread Karen Cravens
On 9 Jun 2001, at 16:21, William wrote: >if (($L) = ($_) =~ m/\b([0-9.0-9.0-9.0-9]+)\b/ ) { A valid IP address is going to look like four groups of one to three digits separated by dots. So if "one to three digits" is \d{1,3} (\d is the same as [0-9]), the regex is going to want to look s

Re: extracting substr

2001-06-09 Thread iain truskett
* William ([EMAIL PROTECTED]) [09 Jun 2001 23:26]: > hi, > i want to be able to read a text file and extract only the valid > ip addresses. however, along with valid ip addresses my code is > grabbing "periods" and invalid ip addresses, e.g., .xxx, > www.xxx.yyy . how can i correct this? It migh

Re: extracting substr

2001-06-09 Thread William
thanks, Karen & Iain, et el,, this helps greatly. the book is on order, can't believe the title of that section, gee. ;-) Bill Karen Cravens wrote: iain truskett wrote: [...]

Re: extracting substr

2001-06-10 Thread Matt Cauthorn
This works for me... #!/usr/bin/perl -w while (<>){ print if $_=~/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/; } Regards, Matt --- William <[EMAIL PROTECTED]> wrote: > hi, > > i want to be able to read a text file and extract only the valid > ip addresses. however, along with valid ip addres

Re: extracting substr

2001-06-11 Thread Dave Cross
On Sat, Jun 09, 2001 at 06:33:21PM -0500, Karen Cravens ([EMAIL PROTECTED]) wrote: > On 9 Jun 2001, at 16:21, William wrote: > > >if (($L) = ($_) =~ m/\b([0-9.0-9.0-9.0-9]+)\b/ ) { > > A valid IP address is going to look like four groups of one to three > digits separated by dots. > > So i

Re: extracting substr

2001-06-11 Thread Karen Cravens
On 10 Jun 2001, at 10:05, Dave Cross wrote: > On Sat, Jun 09, 2001 at 06:33:21PM -0500, Karen Cravens ([EMAIL PROTECTED]) wrote: > > Someone can probably fine-tune which places don't > > actually need three digits and whatnot, too. > It can be a bit more complex that that tho'. The first diit i

Re: extracting text

2002-07-03 Thread Janek Schleicher
Charlie Farinella wrote at Wed, 03 Jul 2002 23:51:44 +0200: > I have the following script that prints email addresses enclosed in <> from a >logfile. It works > by removing everything up to and including the bracket on the left, and then doing >the same on the > right. I would like to be able

RE: extracting text

2002-07-03 Thread Timothy Johnson
-- From: Janek Schleicher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 3:10 PM To: [EMAIL PROTECTED] Subject: Re: extracting text Charlie Farinella wrote at Wed, 03 Jul 2002 23:51:44 +0200: > I have the following script that prints email addresses enclosed in <> from a logf

extracting a string

2003-07-28 Thread Joe Echavarria
Hi there, What perl function can i use to extract a sub-string from a string. I have "myfile.txt", and i only want to print "myfile" to the screen , how can i do it ? Thanks. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web si

RE: extracting text

2003-08-04 Thread wiggins
On 04 Aug 2003 14:08:29 -0700, Bryan Irvine <[EMAIL PROTECTED]> wrote: > I'm trying to build a script to automagically black-list spammers. How > can I extract the ip address from between [ ]? > > turn this: > > Received: from 24.60.195.149 (h0

RE: extracting text

2003-08-04 Thread Bryan Irvine
> > Assuming there is only one set of brackets on a line, and you only want the IP > address between them, and READLOG is an open handle to your log: > > - Not Tested - > my @ips; > while (my $line = ) { >if ($line =~ /\[(.*)\]/) { > push @ips, $1; >} >else { > print STD

RE: extracting text

2003-08-05 Thread ccarver
This is what I came up with. Tested and works. #!/usr/bin/perl -w use strict; open DATA, "ips.txt"; # this is the output file with the ip list while () { if ($_ =~ /\[(\w+\.\w+\.\w+\.\w+)\]/) { print IPS "$1\n"; } } Chris Carver Pennswoods.net Mail Administrat

Re: extracting text

2003-08-09 Thread John W. Krahn
Bryan Irvine wrote: > > [EMAIL PROTECTED] wrote: > > > > Assuming there is only one set of brackets on a line, and you only > > want the IP address between them, and READLOG is an open handle to > > your log: > > > > - Not Tested - > > my @ips; > > while (my $line = ) { > >if ($line =~ /\[(.*

Extracting Multiple Lines

2002-02-21 Thread Marc Morrison
I have an online form that has a "Comments" field. I need to extract ALL of the information from the comments field. Each "Comments" line begins with Comment: so the /^Comments/ works to match that, however the user may, or may not enter a new line in their comments and they may or may not sta

extracting character string

2001-09-25 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! How can i do to extract a string between two others strings ? Thanks Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

extracting email addresses

2001-11-08 Thread Pete Emerson
When I send mail to a certain address, the mail gets piped to my perl script. I'm then using Mail::Internet to extract info, including the From header. For me, the header looks like this Pete Emerson <[EMAIL PROTECTED]> 1. I assume that they're all going to look different. Is that correct? 2. Is

extracting between tags

2001-11-12 Thread Steve Tattersall
Please help I am trying to extract the line begining with GB and also the Title between html tags from multiple html files. For example I want to extract the line: (see the html code below) GB 0152 MSS.126/NUDL and also the title which is: National Union of Dock, Riverside and General Workers

extracting multiple statements ...

2008-09-22 Thread Sharan Basappa
Hi, I have a code snippet as follows: keyword id1 = a x b x c; keyword id2 = c x d x e; I would like to extract strings "a x b x c" and "c x d x e". I know I can loop through the code and extract the strings, but is there a RE that can do this with a single statement. My first guess was to use /

extracting href parts

2008-10-04 Thread Ankur
Hi, I am trying to develop an app for my website for which i need to get the name of the Shows from http://tv.yahoo.com/listings. If you go over the code you can see that some of the rows have the shows with hyperlink and others without. How do i get the Hyperlink and the show's name from the hyp

extracting common substrings...

2006-12-12 Thread Helliwell, Kim
Is there a function (perhaps in a library module) that would take two strings and return the common substring (if any) contained in the arguments? I've been looking for such a beast on CPAN, but no luck so far. If not, I guess I have to write it myself... Any help appreciated. Kim Helli

Re: extracting coordinates

2005-05-09 Thread Philip M. Gollucci
Aditi Gupta wrote: if(my $line =~ /^/$a/\s* (\s*\d+) \s*/$c/\s* \d* \w+ \s \w (\s*\d+) \w* (\s*\d*) (\s*\d*) (\s*\d*) (\s*\d*) (\s*\d*) (\w*\s*) (\s*\w*) (\s*\w*)/) Couple things: perldoc perlre perldoc perlop /^/$a/\s* you're not doing a subsitution, you have too many / /^$a\s*

Re: extracting coordinates

2005-05-09 Thread mgoland
- Original Message - From: Aditi Gupta <[EMAIL PROTECTED]> Date: Monday, May 9, 2005 11:41 am Subject: extracting coordinates > Hi everyone, Hello Aditi, > > That code is working... > But my specific problem is as follows: > > i have a file in which data is

Re: extracting coordinates

2005-05-09 Thread Aditi Gupta
Record name "ATOM " 7 - 11 Integer serial Atom serial number. these are the 1st two fields. On 5/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > - Original Message - > From: Aditi Gupta <[EMAIL PROTECTED]> > Date: Monday, Ma

Re: extracting coordinates

2005-05-09 Thread mgoland
- Original Message - From: Aditi Gupta <[EMAIL PROTECTED]> Date: Monday, May 9, 2005 12:52 pm Subject: Re: extracting coordinates > hi, Hello, > the fields can not be splitted using /s because some fields have > common > boundaries, i.e. some fields are from co

Re: extracting coordinates

2005-05-09 Thread perlocean
- Original Message - From: "Aditi Gupta" <[EMAIL PROTECTED]> To: Sent: Monday, May 09, 2005 10:41 AM Subject: extracting coordinates Hi everyone, while(){ my @fields = split /\s/; if (/([-]\d{1,2}\.\d{2,3})\s([-]\d{1,2}\.\d{2,3})\s(\d{1,2}\.\d{2,3})/ and $fields[2] eq

Re: extracting coordinates

2005-05-09 Thread perlocean
- Original Message - From: "Aditi Gupta" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: Sent: Monday, May 09, 2005 11:52 AM Subject: Re: extracting coordinates hi, the fields can not be splitted using /s because some fields have common boundaries, i.e. some fields

Re: extracting coordinates

2005-05-09 Thread perlocean
- Original Message - From: <[EMAIL PROTECTED]> To: "Aditi Gupta" <[EMAIL PROTECTED]>; Sent: Monday, May 09, 2005 5:06 PM Subject: Re: extracting coordinates - Original Message - From: "Aditi Gupta" <[EMAIL PROTECTED]> To: Sent:

Re: extracting coordinates

2005-05-09 Thread Aditi Gupta
$y, $z)=/^.{27}(.{8})(.{8})(.{8})/o; > } > > joe > > > > On 5/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > - Original Message - > > > From: Aditi Gupta <[EMAIL PROTECTED]> > > > Date: Monday, May 9, 2005 11:41 am > > > Su

Re: extracting coordinates

2005-05-09 Thread Aditi Gupta
$y, $z)=/^.{27}(.{8})(.{8})(.{8})/o; > } > > joe > > > > On 5/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > - Original Message - > > > From: Aditi Gupta <[EMAIL PROTECTED]> > > > Date: Monday, May 9, 2005 11:41 am > > > Su

RE: extracting columns

2005-05-17 Thread Ankur Gupta
From: Aditi Gupta [mailto:[EMAIL PROTECTED] > Hi everybody, > to extract data columnwise from a file, the following code > was written with the help of perl experts of this list. the > script is as follows: > > -- > -

Re: extracting columns

2005-05-17 Thread Xavier Noria
On May 18, 2005, at 8:03, Aditi Gupta wrote: for (my $j=0; $j<$x; $x++) The last one would surely be $j++. the code isn't giving any errors but it also isn't printing the result as well. Please someone tell me why is this happeining.. Please, next time format your code using standard conventions,

RE: extracting columns

2005-05-17 Thread Thomas Bätzler
Aditi Gupta <[EMAIL PROTECTED]> wrote: > to extract data columnwise from a file, the following code > was written with the help of perl experts of this list. the > script is as follows: > #!usr/bin/perl > use warnings; use strict; > my %hash; > > $file= "try.txt"; > > open (FH, $file) or di

Re: extracting columns

2005-05-18 Thread Aditi Gupta
Thanks eveybody.. Knowing how to debug programs will always help. And i'm sorry for not formatting the program according to standard conventions.. i'll do that in future. thanks Thomas for the help:-) On 5/18/05, Ankur Gupta <[EMAIL PROTECTED]> wrote: > > From: Aditi Gupta [mailto:[EMAIL PROTE

problem with extracting line

2005-01-12 Thread Anish Kumar K.
Hi I have text file in which I have the below mentioned lines This is a test start-first First Line testing end-first How are you Finally start-second Tested end-second I have a perl file which reads the above file and stores in the variable say $message #!/u

Extracting and email address

2005-01-21 Thread Andrew Black
Is there a module to extract the real email address from a header. e.g. given "blah blach" <[EMAIL PROTECTED]> extracts the [EMAIL PROTECTED] I am loathe to roll my own - sure there are formats I haven't thought of. Andrew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Extracting attachments from emails

2002-07-18 Thread Steve Gilbert
Does anyone have a suggestion for extracting file attachments from emails? I need to setup a process that pulls data from an email and then moves the data and starts another process. Any help would be great! Thanks, Steve __ Do You Yahoo!? Yahoo

Extracting attachment from mail

2004-05-13 Thread NYIMI Jose (BMB)
Hello, I need to write a perl script that will run on solaris and the job of this script will be : - read a mail from a predefined shared mail box (Outlook/Exchange Server) - extract the mail attachment (text file) - parse the content - create an excel sheet (same content) Any input is welcome

Re: extracting a string

2003-07-28 Thread Casey West
It was Monday, July 28, 2003 when Joe Echavarria took the soap box, saying: : : : Hi there, : : What perl function can i use to extract a sub-string from a : string. : : : I have "myfile.txt", and i only want to print "myfile" to the : screen , how can i do it ? If you woul

RE: extracting a string

2003-07-28 Thread Dan Muey
> Hi there, > > What perl function can i use to extract a > sub-string from a string. > > $string = 'myfile.txt'; $string =~ m/^(\w+)\.txt$/; print $1; HTH DMuey > I have "myfile.txt", and i only want to print > "myfile" to the screen , how can i do it ? > > >Thanks.

RE: extracting a string

2003-07-28 Thread Joe Echavarria
Thanks. --- Dan Muey <[EMAIL PROTECTED]> wrote: > > Hi there, > > > > What perl function can i use to extract a > > sub-string from a string. > > > > > > $string = 'myfile.txt'; > > $string =~ m/^(\w+)\.txt$/; > > print $1; > > HTH > > DMuey > > > I have "myfile.txt", and i

RE: extracting a string

2003-07-28 Thread Tara Calishain
At 01:22 PM 7/28/2003, you wrote: >> Hi there, >> >> What perl function can i use to extract a >> sub-string from a string. >> >> > >$string = 'myfile.txt'; > >$string =~ m/^(\w+)\.txt$/; > >print $1; When I saw this question I immediately thought my $string = "myfile.txt"; my $subst

RE: extracting a string

2003-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Tara Calishain said: >At 01:22 PM 7/28/2003, you wrote: > >>> What perl function can i use to extract a >>> sub-string from a string. >> >>$string = 'myfile.txt'; >> >>$string =~ m/^(\w+)\.txt$/; > >When I saw this question I immediately thought > >my $string = "myfile.txt"; >my $s

Re: extracting a string

2003-07-29 Thread Rob Dixon
"Jeff 'Japhy' Pinyan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Jul 28, Tara Calishain said: > > >At 01:22 PM 7/28/2003, you wrote: > > > >>> What perl function can i use to extract a > >>> sub-string from a string. > >> > >>$string = 'myfile.txt'; > >> > >>$string =~ m

Help with extracting text

2003-12-30 Thread Zary Necheva
Hi everyone, How can I extract the text before the first occurrence of dot (.) or single space from the first field. This is my file LB1571 5TH .W43 1993|text1|text1| FICT. V.12|text2|text2| FICT.|text3|text3| HQ806 .B35 1995|text4|text4| G530.T6B4941988Q|text5|text5| MPCD11 .B42 P27|text6|text

Re: Extracting Multiple Lines

2002-02-21 Thread Jonathan E. Paton
> Also there are no delimiting characters to search. > And one more problem is that they rarely end the > sentence with a period. The only good news is that > there are never more than 4 lines. But because there > is almost always a newline, I can't use: > > while <> > > because it searches l

Extracting data from html

2002-05-21 Thread Alan Hogue
Hi, If anyone can help me with this, I'd be much obliged. I'm probably missing something obvious. I have a variable with a long line of html in it, and I need to take certain elements from it and store them in their own variables. I can figure out how to match the parts that I need with a regul

Re: extracting character string

2001-09-25 Thread GoodleafJ
cc: Subject: extracting character string

RE: extracting character string

2001-09-25 Thread John Edwards
nd give an example of the code you are using. -Original Message- From: COLLINEAU Franck FTRD/DMI/TAM [mailto:[EMAIL PROTECTED]] Sent: 25 September 2001 13:11 To: Perl (E-mail) Subject: extracting character string Hi! How can i do to extract a string between two others strings ? Thanks Fran

RE: extracting character string

2001-09-25 Thread Brett W. McCoy
On Tue, 25 Sep 2001, John Edwards wrote: > $data = "thisisa$biglongstring$ofdata"; > > ($found) = $data =~ /\$(.*)\$/; > > print $found; > > Like that? It will find and print and characters between the two dollar > signs in the first string. For that example, you could use split also. :-) -- Br

Re: extracting between tags

2001-11-12 Thread Andrea Holstein
Steve Tattersall wrote: > > Please help I am trying to extract the line begining with GB and also the > Title between html tags from multiple html files. > > For example I want to extract the line: (see the html code below) > GB 0152 MSS.126/NUDL > > and also the title which is: > > National

Re: extracting between tags

2001-11-12 Thread Chris Ball
On Mon, 2001-11-12 at 16:31, Steve Tattersall wrote: > For example I want to extract the line: (see the html code below) > GB 0152 MSS.126/NUDL > > and also the title which is: > > National Union of Dock, Riverside and General Workers in Grea > t Britain and Ireland > > does anyone know how to

extracting *just* matched text

2001-11-21 Thread WaspCatcher
hi, how does one extract *just* the matched text in a regular expression, e.g. my $text = "Hello 1234, come in"; if ($text =~ /\d{4,4}/) { #grab just the 4 digit number } thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Extracting messages from Outlook

2001-11-21 Thread Clive Lansink
Hi. I would like to be able to retrieve messages using a Perl script from an Outlook 2000 mailbox. I am currently searching for anything to give me a head start. I've found something that claims to do this for Outlook Express but on further investigation it seems this is designed to run on Unix

RE: extracting links.. continued..

2002-01-16 Thread Lorne Easton
Hi there, Thanks for the advice. I looked at using HTML::LinkExtor but decided against it. I am using code like the following: sub get_urls { my @url_array; my ($data) = @_; print $data; #Put all ")|gi) { my $temp_tag = $1; #Strip out tags #Insert code here.. push @url_array,$temp_tag;

Re: extracting links.. continued..

2002-01-16 Thread Michael Fowler
On Thu, Jan 17, 2002 at 10:10:16AM +1000, Lorne Easton wrote: > Thanks for the advice. I looked at using HTML::LinkExtor but decided against > it. Why would you do that? HTML is deceptively difficult to parse; given a choice, an already mature parser is usually much preferable to a hand-rolled s

Re: extracting multiple statements ...

2008-09-22 Thread Mr. Shawn H. Corey
On Mon, 2008-09-22 at 20:37 +0530, Sharan Basappa wrote: > I have a code snippet as follows: > > keyword id1 = a x b x c; > keyword id2 = c x d x e; > > I would like to extract strings "a x b x c" and "c x d x e". I know I > can loop through the > code and extract the strings, but is there a RE t

RE: extracting multiple statements ...

2008-09-22 Thread Thomas Bätzler
Hi, Sharan Basappa <[EMAIL PROTECTED]> asked: > I have a code snippet as follows: > > keyword id1 = a x b x c; > keyword id2 = c x d x e; > > I would like to extract strings "a x b x c" and "c x d x e". > I know I can loop through the code and extract the strings, > but is there a RE that can

Re: extracting multiple statements ...

2008-09-22 Thread John W. Krahn
Sharan Basappa wrote: Hi, Hello, I have a code snippet as follows: keyword id1 = a x b x c; keyword id2 = c x d x e; I would like to extract strings "a x b x c" and "c x d x e". I know I can loop through the code and extract the strings, but is there a RE that can do this with a single stat

Re: extracting multiple statements ...

2008-09-22 Thread Dr.Ruud
"Mr. Shawn H. Corey" schreef: > my $text = undef; You don't trust much anymore I see. :-) -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: extracting multiple statements ...

2008-09-22 Thread Mr. Shawn H. Corey
On Mon, 2008-09-22 at 19:11 +0200, Dr.Ruud wrote: > "Mr. Shawn H. Corey" schreef: > > > my $text = undef; > > You don't trust much anymore I see. :-) Just because you're not paranoid doesn't mean computers don't hate me! -- Just my 0.0002 million dollars worth, Shawn Linux is obsolete

Re: extracting multiple statements ...

2008-09-23 Thread Sharan Basappa
On Mon, Sep 22, 2008 at 9:02 PM, Thomas Bätzler <[EMAIL PROTECTED]> wrote: > Hi, > > Sharan Basappa <[EMAIL PROTECTED]> asked: >> I have a code snippet as follows: >> >> keyword id1 = a x b x c; >> keyword id2 = c x d x e; >> >> I would like to extract strings "a x b x c" and "c x d x e". >> I know

Re: extracting href parts

2008-10-04 Thread Rob Dixon
Ankur wrote: > > I am trying to develop an app for my website for which i need to get > the name of the Shows from http://tv.yahoo.com/listings. > > If you go over the code you can see that some of the rows have the > shows with hyperlink and others without. How do i get the Hyperlink > and the s

Extracting properties from objects.

2011-01-24 Thread Sean Murphy
Hi All. I am wondering how do you extract properties from objects. If we use WWW:Mechanize as an example. How would you get the properties of the first link. Lets say: my $l = $mec->find_link (text => 'link'); So I would like to find out the text of the link, URL, attribs, etc. This is just a

extracting data from websites

2008-01-21 Thread jm
i need to extract data from websites, tracking the status of various shipments. i'm aware of the LWP module but wondered how many other modules may be useful. i've just glanced over the LWP documentation (not in-depth at all yet) and i'm not sure if it will actually allow me to pull the bits of d

extracting line between words

2006-09-14 Thread mayank . ahuja
Hi Perlers... I need to extract line between two words like @line = "The Sun rises in the east and "; Now I want to extract the line from The word to east For tht I am using the following code: #!/usr/bin/perl use warnings; use strict; my @line = "The Sun r

Re: extracting common substrings...

2006-12-12 Thread Tom Phoenix
On 12/12/06, Helliwell, Kim <[EMAIL PROTECTED]> wrote: Is there a function (perhaps in a library module) that would take two strings and return the common substring (if any) contained in the arguments? You want the longest possible common substring? Or all of the longest ones, if there's more

Re: extracting common substrings...

2006-12-12 Thread John W. Krahn
Helliwell, Kim wrote: > Is there a function (perhaps in a library module) that would take two > strings and return the common substring (if any) contained in the > arguments? I've been looking for such a beast on CPAN, but no luck so > far. Perhaps this is what you require: http://search.cpan.org

Re: extracting common substrings...

2006-12-12 Thread D. Bolliger
Helliwell, Kim am Dienstag, 12. Dezember 2006 21:56: > Is there a function (perhaps in a library module) that would take two > strings and return the common substring (if any) contained in the > arguments? I've been looking for such a beast on CPAN, but no luck so > far. > > > > If not, I guess I h

Re: extracting common substrings...

2006-12-12 Thread D. Bolliger
Tom Phoenix am Mittwoch, 13. Dezember 2006 02:32: > On 12/12/06, D. Bolliger <[EMAIL PROTECTED]> wrote: > > $found{$1}++ for ($s2=~/($search)/g); # although count not used > > below > > Didn't $search just come from the data? It's a string, not a pattern. > If it's got any metacharacters, it

Re: extracting common substrings...

2006-12-12 Thread D. Bolliger
D. Bolliger am Mittwoch, 13. Dezember 2006 02:25: Sorry for answering my own post... [snipped] > The script contains a testcase with "long" strings, it takes 1.2 secs on my > old machine (the test case is certainly not a worst case scenario). [snipped] > ### Test case: > > my $pat=join '', 'hello

Extracting value from regex

2016-06-09 Thread Punit Jain
Hi , Below is the problem I am facing : #!/usr/bin/perl my @str = ('mailto:y...@gmail.com','ldap:///uid=user1,ou=People,o=test.com '); foreach (@str) { # split off ldaps and mailtos my @addr = $_ =~ /ldap:\/\/\/(.+)|mailto:(.+)/; print $1; } When i run

Extracting Directories and Sub Directories

2004-10-25 Thread Ron Smith
The following is the script: ---snip #!/usr/bin/perl -w use strict; use File::Basename; my @lines = dirname `dir /b/s`; print "@lines\n"; ---snip The following is the input: C:\Perl\scripts\shots\sp2\shot_1\dir.t

Re: problem with extracting line

2005-01-13 Thread Randy W. Sims
Anish Kumar K. wrote: Hi I have text file in which I have the below mentioned lines This is a test start-first First Line testing end-first How are you Finally start-second Tested end-second I have a perl file which reads the above file and stores in the variable

Re: Extracting and email address

2005-01-21 Thread Ing. Branislav Gerzo
Andrew Black [AB], on Friday, January 21, 2005 at 10:47 (+) made these points: AB> Is there a module to extract the real email address from a header. e.g. AB> given AB> "blah blach" <[EMAIL PROTECTED]> AB> extracts the [EMAIL PROTECTED] AB> I am loathe to roll my own - sure there are for

Re: Extracting and email address

2005-01-21 Thread Dmitry Nikolayev
Mail::Address is the module you're searching for, I hope.. my @addresses = Mail::Address->parse($head->get('To')); $head is a header object, as you understood With best wishes, Dmitry Nikolayev "Andrew Black" <[EMAIL PROTECTED]> ???/ ? ?: news:[EMAIL PROTECTED]

Re: Extracting and email address

2005-01-21 Thread Dmitry Nikolayev
Of course, you can make the same with your example: my @addresses = Mail::Address->parse('"blah blach" <[EMAIL PROTECTED]>'); print $addresses[0]; The result should be: [EMAIL PROTECTED] With best wishes, Dmitry Nikolayev "Andrew Black" <[EMAIL PROTECTED]> ???/ ? ???

Re: Extracting and email address

2005-01-21 Thread Edward Wijaya
On Fri, 21 Jan 2005 10:47:33 +, Andrew Black <[EMAIL PROTECTED]> wrote: Is there a module to extract the real email address from a header. e.g. Yes there is "Email::Find" Why would you want to extract email addresses? Spamming? -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PR

RE: Extracting and email address

2005-01-21 Thread brian . barto
nners@perl.org Subject: Re: Extracting and email address On Fri, 21 Jan 2005 10:47:33 +, Andrew Black <[EMAIL PROTECTED]> wrote: > Is there a module to extract the real email address from a header. e.g. Yes there is "Email::Find" Why would you want to extract e

Extracting Info from a websource

2003-01-09 Thread Sukrit
Hi listers, i am a perl beginner with an interesting problem (to me atleast :). Problem Overview - Somewhere on the world wide web, exists an asp page with the following form - On entering a valid roll number and pressing enter, results for that number are displayed. Currently

extracting field and getting sum

2003-02-03 Thread Eri Mendz
hello everyone, since im learning perl, i might as well harness its power to solve my small real-world problem. sample lines of my grep'ped ppp log goes like this: Jan 12 05:47:50 localhost pppd[8696]: Connect time 2.2 minutes. Jan 12 19:23:44 localhost pppd[9359]: Connect time 34.0 minutes. [..]

extracting numbers from a string

2003-03-21 Thread Matthew Stapleton
Hello, I am learning Perl and having some fun with it. In a script I am writing I am wanting to read a line of a file and then extract a digit from the beginning of the line. A typical line looks something like this: 100. text text text So I am using a file handle to open the file and read the

extracting a group of keys

2003-06-18 Thread Adriano Allora
Hi to all, I have to compare each line of a very long text file with each line of another one. I stored all the first file lines in an hash - to make the process faster. Now I have that hash with the first word of each line in the value of hash and the entire line in the related key (cause I can

Re: Extracting attachments from emails

2002-07-18 Thread Kevin Meltzer
ve a suggestion for extracting file > attachments from emails? I need to setup a process > that pulls data from an email and then moves the data > and starts another process. > > Any help would be great! > -- [Writing CGI Applications with Perl - http://perlcgi-book.com] I hate it whe

Re: Extracting attachments from emails

2002-07-18 Thread Wiggins d'Anconia
created in > $INCOMING_DIR. Use $entity to fondle the rest of the message as you > want. Much more info in the docs. > > Cheers, > Kevin > > On Thu, Jul 18, 2002 at 10:25:52AM -0700, Steve Gilbert ([EMAIL PROTECTED]) >said something similar to: > >>Does anyone

Re: Extracting attachments from emails

2002-07-18 Thread Kevin Meltzer
d have been parsed out and created in > > $INCOMING_DIR. Use $entity to fondle the rest of the message as you > > want. Much more info in the docs. > > > > Cheers, > > Kevin > > > > On Thu, Jul 18, 2002 at 10:25:52AM -0700, Steve Gilbert ([EMAIL PROTECTED])

Re: Extracting attachments from emails

2002-07-18 Thread John W. Krahn
Kevin Meltzer wrote: > > At this point, attachments should have been parsed out and created in > $INCOMING_DIR. Use $entity to fondle the rest of the message as you > want. Much more info in the docs. Fondling mails Kevin? That doesn't sound very appealing. :-) John -- use Perl; program ful

Re: Extracting attachments from emails

2002-07-18 Thread Kevin Meltzer
It's still legal in 23 states! Honest! Cheers, Kevin On Thu, Jul 18, 2002 at 12:33:28PM -0700, John W. Krahn ([EMAIL PROTECTED]) said something similar to: > Kevin Meltzer wrote: > > > > At this point, attachments should have been parsed out and created in > > $INCOMING_DIR. Use $entity to fon

Extracting text from a phrase

2002-09-17 Thread Ian
Hi, Please excuse this newbie question, but I am getting confused :( I need at have a small script that will extract selected words from a phrase and then insert them into a new string. I have an html page that I need to extract both urls & keywords from and put them into a new file. Should be f

Extracting information using html form

2002-12-13 Thread Sukrit
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi listers, i am a perl beginner with an interesting problem (to me atleast :). Problem Overview - Somewhere on the world wide web, exists an asp page with the following form - On entering a valid roll number and pressing enter, re

Extracting keys and variables, HowTo?

2002-12-16 Thread David
Hi, I have a line in a script my ($class, %args) = @_; and I would like to know how to extract the values of @_ and also how to explicatly state them so that they don't have to be parsed to the script. Thanks. David. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Extracting keys and variables, HowTo?

2002-12-16 Thread David
Hi, I would like to know how to extract the keys and variables from this line of code that are being parsed by @_ my ($class, %args) = @_; Also how would I set then so that they wouldn't have to be parsed to the script. Thanks. David. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Extracting data from html structure.

2004-02-18 Thread Christian Wattengård
I have the following html structure:  Norske NRK 1 TV 2 TVNorge NRK 2 TV 3 ZTV  Nordiske 3+< br> DR1 DR2 SVT 1 SVT 2 Kanal 5 TV2 Dan TV3 Dan TV3 Sve TV4 TV6 Sve ZTV Sve  Nyheter BBC Wor

  1   2   3   4   5   >