04-19-2002
2,
0
Join Date: Apr 2002
Last Activity: 13 December 2008, 12:51 AM EST
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
metamail
Hi there. I have a problem with some files I am trying to process. It goes as follows:
I receive an email with a MIME attachment
I use metamail to extract the data to a flat file named "email.txt"
I decode "email.txt" using metamail
This works great with one tiny issue
Information in the file that I receive is 1000 rows of invoice data that needs to be stripped of ANY extra characters that may be in the file, so that all I am left with is the pure data.
But at the end of every file is something like:
------_=_NextPart_000_01C1E6F8.678CC080--
or like this:
------_ÿextPart_000_01C1E6F8.678CC080-- (once I have metamailed it)
I need to be able to get rid of these extra characters some how. I thought of using grep somehow (?) or some other techinique, but these "weird" characters seems to be changing with every file, so I am at a loss on how to do this.
I am using a PERL program that calls metamail using "system(..)", so maybe there is a cool trick in PERL as well?
If anyone could help, I would really appreciate it.
Thanks in advance