|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Parsing semi-erratic textby SamCG (Hermit) |
| on Aug 23, 2006 at 15:23 UTC ( [id://569180]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.SamCG has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to parse the bodies of some automated emails. One would think it would be easy, but for some reason the generator of the emails does NOT cut lines using a \n, but by adding spaces. The number of spaces added seems to vary. Initially I broke the email into an array by splitting on \s{15,}, but this isn't ideal, and drops some of the values. I'm considering splitting on the colons, but I'm not convinced this is a great idea and seems to lead to more headaches. Any ideas for a somewhat robust, straightforward way to parse this?
----------------- s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||