Extracting email header

Hi,

I got problem in extracting email header like

From: [email protected]
To: [email protected]
Subject: jjjjjjj

Actually i already fetch a the received mail using fectmail to a
ForActionMailer.txt file. But the text is contain plain text and
attachment. I already extracting out the attachment which is lmx file.
Currently i want to extract out the header from ForActionMailer.txt file
and append to the lmx file.

Is it possible to do so.

Thanks