How do I convert a file looking like this
It is a mail file read by a text editor
This is the first part:
Content-Type: Multipart/Alternative; boundary="AGENTID00086901-=_HE3OHVVb7ZA1fPquSnpe7qTvp"
This is a multi-part message in MIME format. If your mail reader can't
read MIME messages, you'll find clear message text in the first part
of this mail
--AGENTID00086901-=_HE3OHVVb7ZA1fPquSnpe7qTvp
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=US-ASCII
Content-Description: Message in clear text
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DATE=2006MAY04
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20BOOKING=20REF=20=
YO6EC3
=20
and the end is like this:
U1QgVExGICgrNDcpMjIgMTcgMDIgMDANCiANCkNMSUNLIFRIRSBGT0xMT1dJTkcgTElOSyBU
TyBBQ0NFU1MgWU9VUiBPTkxJTkUgSVRJTkVSQVJZIDoNCjxBIEhSRUY9DQoiSFRUUFM6Ly9X
V1cuQ0hFQ0tNWVRSSVAuTkVUL0NNVFNFUlZMRVQ/Uj1ZTzZFQzMmTD1HQiZOPUZPTEdFUk9F
ICI+DQpXV1cuQ0hFQ0tNWVRSSVAuTkVUL0NNVFNFUlZMRVQ/Uj1ZTzZFQzMmTD1HQiZOPUZP
TEdFUk9FPC9BPg0KIA0KIDxocj48L1BSRT4=
--AGENTID00086901-=_HE3OHVVb7ZA1fPquSnpe7qTvp--
which I believe is base64 encoded text from the mail.
I have made a script to search the ordinary text for som data,and extract it to a new file. The way I did this was to copy and paste the text from the mail when reading it in a mail client.
I have appx 6000 mails I want to search for data, but I don't want to deal with the text in the avove mentioned format (all the =20).
Anyone who have an idea how to convert this?
i've tried: cat "infile" | openssl enc -a -d > "outfile" without any luck.
Can I use a commandline mail client that runs from a script?
Would be very happy if one of you clever guys have an approach to this.
Best regards
|