CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
hmm... problems with this one.. can someone help??

 



chetwyn
Novice

Apr 26, 2006, 6:09 AM

Post #1 of 4 (1018 views)
hmm... problems with this one.. can someone help?? Can't Post

Hi all. I want to only retrieve the lines of text that have no spaces breaking the text. for example, here is some exmaple text:

**** START ****


Sydney City Plumbing
Unit 3/5- 7 Stanley St Peakhurst NSW 2210


Dempsey Plumbing & Electrical
408- 410 Canterbury Rd Campsie NSW 2194


Paul Bevins
94A Cardinal Ave West Pennant Hills NSW 2125


Conomos Plumbing

RPM Pipeline Maintenance
Werrington Downs NSW 2747



**** END ****

So I only want things like:

RPM Pipeline Maintenance
Werrington Downs NSW 2747

Not like

Conomos Plumbing



This is what I have so far but it's not working...

open (IN,"teststr.txt")||die"can not open file\n";
close(IN);
while(<IN>){
$_ =~ /^\w+.*\w+$/s;
print $_."\n";
}


KevinR
Veteran


Apr 26, 2006, 9:41 AM

Post #2 of 4 (1015 views)
Re: [chetwyn] hmm... problems with this one.. can someone help?? [In reply to] Can't Post

stop posting in the advanced forum mate, this is beginner stuff.
-------------------------------------------------


MrPJ
User

Apr 26, 2006, 2:46 PM

Post #3 of 4 (1014 views)
Re: [KevinR] hmm... problems with this one.. can someone help?? [In reply to] Can't Post

Why not answer the question or don't say anything at all and let a moderator move the thread seeing as you can't ;)


KevinR
Veteran


Apr 26, 2006, 9:14 PM

Post #4 of 4 (1006 views)
Re: [chetwyn] hmm... problems with this one.. can someone help?? [In reply to] Can't Post

chetwyn,

I just want to make sure you didn't misunderstand me.... post questions like this in the beginner forum mate.

Sincerely,
KevinR, wannabe moderator

Cool
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives