For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > April 2005 > removing lines that start with certain characters









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author removing lines that start with certain characters
socialism001@yahoo.com

2005-04-25, 8:56 pm

I'm trying to learn perl. What I'm trying to do is remove lines that
begin with From:,Sent:,To:,Subject:

Thanks,
Chris

peter pilsl

2005-04-25, 8:56 pm

socialism001@yahoo.com wrote:
> I'm trying to learn perl. What I'm trying to do is remove lines that
> begin with From:,Sent:,To:,Subject:
>


Well, I suppose formail ist a perfect program to do remove Headers from
mails, but if you like to learn about pattern-matching and regular
expression in perl, I recommend man perlre

A possible expression for your request is /^(From|Sent|To|Subject):/
The rest of the programm is obvious up to you. If you have troubles with
the rest, just post what you already tried and what problems you
encountered.

At least I always support socialism if he really seems to try :)

best,
peter


--
http://www.goldfisch.at/know_list
Tad McClellan

2005-04-25, 8:57 pm

socialism001@yahoo.com <socialism001@yahoo.com> wrote:
> I'm trying to learn perl. What I'm trying to do is remove lines that
> begin with From:,Sent:,To:,Subject:



Show us your code and we will help you fix it.


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
socialism001@yahoo.com

2005-04-26, 3:59 am

You guys are quick. I was going to modify it. This is what I got from
the html I want to remove:

<B>From:</B> Jeffrey S. Smith [sender+0ef8.4bge4@eh2.net]<BR>

Basiclly remove everything starting with the <B>From to the first <BR>.
I'll work on it more tonight.

Thanks,
Chris

Tad McClellan

2005-04-26, 3:59 am

socialism001@yahoo.com <socialism001@yahoo.com> wrote:

> the html I want to remove:



perldoc -q remove

How do I remove HTML from a string?


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com