Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Search a Text File for a String, Return String to Function

Reply
Thread Tools

Search a Text File for a String, Return String to Function

 
 
cl@supportreport.org
Guest
Posts: n/a
 
      07-29-2006
Howdy

So while I've been able to do things similar to this in other languages
I thought I'd sharpent my Perl skills but, alas, those skills were more
dull then I thought.

What I'm trying to do is search a text file for a string "<a
href="something">" and return that something do another part of the
script. The "something" part changes at random so that one day the
first line of the file I am searching could be

"<a href="something">"

and the next day it could be

"<a href="and now for something completly different">"

So I guess what I'm saying is I want to return whatever is between the
quotes that start after the first instance of href that Perl finds in
the file.

Thoughts on how to go about this in a somewhat effeciant way?

 
Reply With Quote
 
 
 
 
Dr.Ruud
Guest
Posts: n/a
 
      07-29-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) schreef:

> So while I've been able to do things similar to this in other
> languages I thought I'd sharpent my Perl skills but, alas, those
> skills were more dull then I thought.
>
> What I'm trying to do is search a text file for a string "<a
> href="something">" and return that something do another part of the
> script. The "something" part changes at random so that one day the
> first line of the file I am searching could be
>
> "<a href="something">"
>
> and the next day it could be
>
> "<a href="and now for something completly different">"
>
> So I guess what I'm saying is I want to return whatever is between the
> quotes that start after the first instance of href that Perl finds in
> the file.
>
> Thoughts on how to go about this in a somewhat effeciant way?


From all those I guess that you just want to find the value of a link in
HTML?
http://search.cpan.org/search?query=...nk&mode=module

Did you read the Posting Guidelines yet?

--
Affijn, Ruud

"Gewoon is een tijger."


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: text file search to text file output possible? Whiskers Computer Support 3 10-07-2006 06:32 PM
Re: text file search to text file output possible? Mitch Computer Support 0 10-06-2006 11:15 PM
what value does lack of return or empty "return;" return Greenhorn C Programming 15 03-06-2005 08:19 PM
Search for string and return file name Örjan Johansson Perl Misc 6 11-20-2004 12:51 PM



Advertisments