LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-26-2006, 08:29 AM   #1
anil3
LQ Newbie
 
Registered: Mar 2006
Location: Norway
Distribution: Fedora
Posts: 14

Rep: Reputation: 0
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
 
Old 09-26-2006, 10:09 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Search for "mpack .rpm", then "munpack -C /temp/dir /path/and/mailbox/name" should do.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto convert bin file to a executable DOS file lilzz Linux - Newbie 5 08-04-2006 12:03 AM
convert text file to binary excel file ust Linux - General 2 11-23-2004 02:33 AM
How to convert .deb file to .tar file on redhat? zhu_liheng Linux - Newbie 1 01-15-2004 08:11 PM
Convert Open Office file to PDF file. liguorir Linux - Software 1 01-13-2004 12:44 PM
How to convert a txt file to be a db file in Redhat linux 9? winnie Linux - Newbie 3 06-27-2003 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration