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: Intermediate:
a line as a seperator, how..not pipes or tabes,

 



BrightNail
Novice

Jul 27, 2001, 11:41 AM

Post #1 of 6 (1392 views)
a line as a seperator, how..not pipes or tabes, Can't Post

Hey,
this is somewhat similiar to my other post.

I have a list of names with addresses (an entry), each entry is seperated by a long line ala...
_______________________________

now, I have around 15-20 entries per file. So, I want to split at the long line and then funnel each address and name on its own line in a textfile...each individual entry seperated by a pipe.
so.....

___________________________
John Doe

1234 Somewhere Lane
Brockton, Ma. 01149
www.blahblahblah.whatever

would read into the flat like this

John Doe | 1234 Somewhere Lane | Brockton, Ma | www.blahblahbalh.whatever

on its own line.........basically, after the perl script reads in the text file I supply (and if there are 15 entries per file),,then the new flatfile created would have 15 lines of addresses and name...does that make sense.

I just don't know how to break on that long line and disregard it, and use the contents after it until the next line etc....

thanks a bunch



abstracts
Novice

Jul 27, 2001, 1:22 PM

Post #2 of 6 (1386 views)
Re: a line as a seperator, how..not pipes or tabes [In reply to] Can't Post

Hello,

So, Jasmine and Marcus both did their bests (even more). They both wrote you functional programs that really worked. They also went through all the trouble of explaining how their programs worked and what output you should expect from them. Instead of following their advice, you posted the question again. So, do you want to learn perl, or just get someone to write your program?

Aziz,,,





BrightNail
Novice

Jul 27, 2001, 1:28 PM

Post #3 of 6 (1385 views)
Re: a line as a seperator, how..not pipes or tabes [In reply to] Can't Post

that is cold,
I did try their programs and they didn't work. Did you try it? Then why are you saying it did work.

The thing is, this latest question how to seprate entries based on a line is only 1/4 of the issue. ONce I know how to do that, I can figure out the rest and already know how to do the rest. NO< I don't want them to write it for me........but working 60 hours a week in the real world makes it very hard to sit at home and practice programming all day while waiting for your dinner that your mom prepared.



veredox
stranger

Jul 27, 2001, 1:36 PM

Post #4 of 6 (1385 views)
Re: a line as a seperator, how..not pipes or tabes, [In reply to] Can't Post

The attached should do what you asked + ignore blank lines and treat consecutive _____'s as one.
Simply add filenames you wish to change as arguments on the command line.

Best wishes,
Matt Murphy



BrightNail
Novice

Jul 27, 2001, 1:47 PM

Post #5 of 6 (1382 views)
Re: a line as a seperator, how..not pipes or tabes, [In reply to] Can't Post

can you email it, for some reason I can't get it from this site. ----> venicesrfr@aol.com

thanks a lot....-->



abstracts
Novice

Jul 27, 2001, 2:06 PM

Post #6 of 6 (1379 views)
Re: a line as a seperator, how..not pipes or tabes [In reply to] Can't Post

Hello,

Sorry for all your frustration and your workload. I hope you get your work done. And sure, why don't we have dinner after work one day. Maybe we can practice some perl to go with it. I can't wait.

Wish you good luck.

Aziz,,,


 
 


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

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