Re: Strip email attachments using IMAP.

2009-04-18 Thread Chas. Owens
On Sat, Apr 18, 2009 at 06:26, Meghanand Acharekar wrote: > Hi, > > Is it possible to strip email attachments from a remote IMAP folders & save > or download  them on local system (system on which script is running) > > I written a simple script using perl IMAPClient which connects IMAP server > a

RE: Strip email attachments using IMAP.

2009-04-18 Thread Jeff Pang
Could use Net::POP3 to fetch the whole message, then use MIME::Lite(::*) to parse it and get the attachment (given the case you know something about rfc822). regards. > Original Message > Subject: Strip email attachments using IMAP. > From: Meghanand Acharekar > Date: Sat, Apr

Re: Strip HTML from files in a directory

2008-11-12 Thread Chas. Owens
On Wed, Nov 12, 2008 at 15:44, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Tue, Nov 11, 2008 at 17:17, bdy <[EMAIL PROTECTED]> wrote: > snip >> Sorry, I should have mentioned I was an ultra-beginner. Aside from >> using that in a .pl file, how else could I execute that for multiple >> files in a di

Re: Strip HTML from files in a directory

2008-11-12 Thread Chas. Owens
On Tue, Nov 11, 2008 at 17:17, bdy <[EMAIL PROTECTED]> wrote: snip > Sorry, I should have mentioned I was an ultra-beginner. Aside from > using that in a .pl file, how else could I execute that for multiple > files in a directory? snip #!/usr/bin/perl use strict; use warnings; use HTML::TreeBuil

Re: Strip HTML from files in a directory

2008-11-12 Thread bdy
On Oct 29, 10:57 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: > bdy wrote: > > > Does anyone know if there's a way to use an HTMLstripperin Perl to > > scrub the HTML from all files in a specified directory? If so, would > > you point me in the correct direction. > > I would recommend something like >

Re: Strip HTML from files in a directory

2008-10-29 Thread Rob Dixon
bdy wrote: > > Does anyone know if there's a way to use an HTML stripper in Perl to > scrub the HTML from all files in a specified directory? If so, would > you point me in the correct direction. I would recommend something like use HTML::TreeBuilder; my $tree = HTML::TreeBuilder->new_from_c

RE: Strip HTML from files in a directory

2008-10-29 Thread Stewart Anderson
> -Original Message- > From: bdy [mailto:[EMAIL PROTECTED] > Sent: 29 October 2008 15:14 > To: beginners@perl.org > Subject: Strip HTML from files in a directory > > Does anyone know if there's a way to use an HTML stripper in Perl to > scrub the HTML from all files in a specified director

Re: strip

2006-07-15 Thread Dr.Ruud
"WCJ d/b/a http://ccsh.us/"; schreef: > Rob Dixon: >> John W. Krahn: >>> s/_.*\././; >> >> Sometimes Perl regexes start to look like ASCII art! > > Thats why this format would be easier on the eyes: > > s|_.*\.|.|; Variants: s| _ .* [.] |.|x s! _ .* [.] !.!x s{ _ .* [.] }{.}x -- Affijn

Re: strip

2006-07-15 Thread WCJ d/b/a http://ccsh.us/
On 7/14/06, Rob Dixon <[EMAIL PROTECTED]> wrote: John W. Krahn wrote: > > s/_.*\././; Sometimes Perl regexes start to look like ASCII art! Thats why this format would be easier on the eyes: s|_.*\.|.|; -- WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/ -- To unsubscribe, e

Re: strip

2006-07-15 Thread Dr.Ruud
Rob Dixon schreef: > John W. Krahn: >> s/_.*\././; > > Sometimes Perl regexes start to look like ASCII art! It is a BRE, so far older than Perl. :) -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: strip

2006-07-14 Thread Rob Dixon
John W. Krahn wrote: s/_.*\././; Sometimes Perl regexes start to look like ASCII art! Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: strip

2006-07-14 Thread John W. Krahn
Nishi Bhonsle wrote: > Hi: Hello, > I have a filenames such as NQSname_l_cs.txt, NQSname_l_da.txt, > NQSname_l_zh- > tw.txt etc. > I would like to modify these filenames such that they are NQSname.txt > > What regex i could use to modify these filenames? s/_.*\././; John -- use Perl; program

RE: strip

2006-07-14 Thread Timothy Johnson
Here's one way to do it: # if($file =~ /^NQSname.+\.txt$/){ rename ($file,'NQSname.txt'); } # -Original Message- From: Nishi Bhonsle [mailto:[EMAIL PROTECTED] Sent: Friday, July 14, 2006 5:29 PM To: beginners perl Subject: strip Hi: I have a filenames such as NQ

Re: Strip Characters from a particular field

2002-06-08 Thread David T-G
Fred -- Would you please fix your addressing from <> so that replies will work properly? ...and then Fred Sahakian said... % % Hi Folks, Hello! % % $value =~tr/+/ /; will remove the "+" from all the form fields and replace it with a space, how can I ask the program to remove the "+" fro

Re: Strip html from filehandle? >was win command console exe how perl launch & capture its STDOUT?

2002-05-31 Thread Felix Geerinckx
on Fri, 31 May 2002 01:57:19 GMT, [EMAIL PROTECTED] (Alan C.) wrote: > my $output = qx(graburl > http://www.wrh.noaa.gov/cgi-bin/Sacramento/afd?SFOZFPSTO); > open MYWTHR, ">myweathr" > or die "Cannot create mywthr_txt: $!"; > print MYWTHR "$output"; > #end-- > But it pulls all content,

Re: Strip $ from variable

2002-04-15 Thread drieux
In case no one has mentioned it, there are good reasons for using '-w' and "use strict;" in your perl code On Monday, April 15, 2002, at 05:16 , Daniel Falkenberg wrote: [..] > $string = "$20.90"; > > $string =~ s/$//; <-- I figured this would work fine? [..] if you had used '-w' and strict

Re: Strip $ from variable

2002-04-15 Thread Jeff 'japhy' Pinyan
On Apr 15, Daniel Falkenberg said: >I was just wondering how I would go about stripping the $ sign from the >following string? > >$string = "$20.90"; That won't do what you expect -- $string is probably ".90" now. $20 is a variable (set by a regex) and is probably undef. You need either '$20.9

RE: Strip $ from variable

2002-04-15 Thread Mark Anderson
You need to escape the $ in the regex: $string =~ s/\$//; -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Monday, April 15, 2002 5:16 PM To: [EMAIL PROTECTED] Subject: Strip $ from variable Hello All, I was just wondering how I would go about stripping the $

Re: Strip Carriage Returns

2002-04-04 Thread Kevin Hancock
Cure: Make this script on linux box, call it strip-dos, and run it make it executable first ~#chmod 700 strip-dos ~#./strip-dos file-name Creates a file called file-name.stripped so it doesn't mess with the origional. The magic is in the last line, if you want to type command each time just run

Re: Strip Carriage Returns

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 09:05, Glenn Cannon wrote: > Not strictly a perl question, I know, but... > > I have been writing and testing my perl script on a WinXP box, and I > have now moved it to its final home on a linux box. When I run perl -c > scriptname, I get the following: > > Illegal char

Re: Strip Carriage Returns

2002-04-04 Thread Elaine -HFB- Ashton
Glenn Cannon [[EMAIL PROTECTED]] quoth: *> *>Illegal character \015 (carriage return) at index.pl line 2. *>(Maybe you didn't strip carriage returns after a network transfer?) *> *>Is there a simple way to prevent/cure this? Several. Most modern Unixes have 'dos2unix' available or you can use P

RE: Strip Carriage Returns

2002-04-04 Thread John Edwards
How did you move the file? File copy? FTP? *nix systems use line feeds at the end of lines in text files. Windows systems use LF\CR. Or the other way round. That's the cause of your problem anyway. One way of solving it is to FTP the file to the box in asci mode, I believe. This might help htt

Re: strip first space

2002-03-01 Thread Elaine -HFB- Ashton
[EMAIL PROTECTED] [[EMAIL PROTECTED]] quoth: *> *>$string =~ s/^\s+//; Removes leading whitespaces *> *>$string =~ s/^\s+//g; /g (GLOBALLY) is redundant in the *>case of "leading whitespages" For a beginner, it's a not a critical detail. e. -- To unsubscribe,

RE: strip first space

2002-03-01 Thread Jason Larson
> If I have a string and the first character is a space, > may not always be a space. > Example: John > Tommy > Beth > > John and Beth have a space, Tommy does not. > How do I strip that. I do not want to use the global > command because a want the space between Fir

Re: strip first space

2002-03-01 Thread William.Ampeh
$string =~ s/^\s+//; Removes leading whitespaces $string =~ s/^\s+//g; /g (GLOBALLY) is redundant in the case of "leading whitespages" See PERL Cookbook page 30 for the answer to your question. __ William Ampeh (x3939) Federal Reserve Board

Re: strip first space

2002-03-01 Thread Elaine -HFB- Ashton
Tanton Gibbs [[EMAIL PROTECTED]] quoth: *> *>The regular expression *>s/^\s//; s/^\s+//g; would be even better as it would remove all whitspace at the beginning of a line and it would replace all matches to the pattern instead of just the first it finds. e. -- To unsubscribe, e-mail: [EMAIL P

Re: strip first space

2002-03-01 Thread Tanton Gibbs
my @arr = (" This has a leading space", "This does not" ); foreach my $string (@arr ) { $string =~ s/^\s//; print $string, "\n"; } prints: This has a leading space This does not The regular expression s/^\s//; means s/ # substitute ^ # at the beginning of the string \s

Re: Strip charactes from every element in array

2001-08-23 Thread Luke Bakken
When you do a for loop : for (@array) { s/1//g; } the implicit $_ in the loop becomes an alias for the real element - so by modifying the element in the loop you're actually modifying the "real" one in the array. Luke PS you could use map here as well, but it's in a void context - big

RE: Strip charactes from every element in array

2001-08-23 Thread HOLLAND-MORITZ,MARCUS (A-hsgGermany,ex1)
August 23, 2001 4:49 PM | To: 'HOLLAND-MORITZ,MARCUS (A-hsgGermany,ex1)' | Subject: RE: Strip charactes from every element in array | | | and if the character isn't there | | @array(one1 two three1); | | I end up with | | one tw three | | -Original Message- |

RE: Strip charactes from every element in array

2001-08-23 Thread HOLLAND-MORITZ,MARCUS (A-hsgGermany,ex1)
| Is there any easy way to strip a single character from every | element in an | array? @array = qw(one1 two1 three1); chop @array; print "@array"; Hope this helps. -- Marcus | -Original Message- | From: John Edwards [mailto:[EMAIL PROTECTED]] | Sent: Thursday, August 23, 2001 4:45 P