Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Search pst files

by Anonymous Monk
on Jan 19, 2012 at 07:00 UTC ( #948702=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:


I have to search a *.pst file for a regular expression. how to open the .pst file and then scan its content for the matching pattern(regular expression)?? Thanks..

Replies are listed 'Best First'.
Re: Search pst files
by jmcnamara (Monsignor) on Jan 19, 2012 at 10:32 UTC

    Outlook's pst files are in a proprietary binary format and you can't just search it like a text file.

    If you are on Windows and have Outlook installed you can use Mail::Outlook.

    Alternatively you can convert the pst file to a text format using a tool such as libpst. See Searching and extracting data from PST files for an example.


Re: Search pst files
by roboticus (Chancellor) on Jan 19, 2012 at 11:24 UTC

    The advice by jmcnamara is what I'd do today. (libpst looks pretty good!)

    But if you can't manage that, you might write a simple VB script to export all the EMail in your .pst file to one or more text files, and then you can use perl to dig through all the data. I had a similar need once, and did it that way. With a little googling, you'll find quite a few VB scripts to export data from .pst files. (I didn't want to learn the Outlook data model, so I just used a script I found on the web to create my text file(s).)


    When your only tool is a hammer, all problems look like your thumb.

Re: Search pst files
by Anonymous Monk on Jan 19, 2012 at 07:14 UTC

      .pst/.ost are outlook files i need to find matching patterns frm them

        Great, then get to it :)

      dbx is a data file used to store emails, contacts, notes in Outlook express. But this files easily damaged or corrupted when exceed 2GB size limit or due to virus attack or application malfunctioning. But there is nothing to worry as by using dbx Outlook express recovery software, you can easily recover damaged or corrupted .dbx files. It incorporated advance algorithm to recover inbox, Outbox, calendars, contacts, drafts etc. Get more details at:
        Repair DBX files by executing a manual process. Executing DBX recovery process requires you to find and locate corrupt DBX files. You can find the location by using Registry Editor. Refer to the "Email File Recovery" category of blog:- You will also find free solution to convert DBX to PST.
Re: Search pst files
by perlrum (Initiate) on Jan 19, 2012 at 14:01 UTC

    You could try something like FileLocator Pro, which supports searching PST files using regular expressions and doesn't require Outlook to be installed on your computer.

    You can run it programmatically from the command line or through scripts using the COM library.

      I am using PSTViewer Pro from Encryptomatic LLC. It can open different type of email files such as .pst, .ost, .eml and .msg. It can also search email fields including Message Text, From, To, CC, Subject, Date Range, Header. You can download the product for free at the link below.
Re: Search pst files
by Anonymous Monk on May 17, 2013 at 21:16 UTC
    You need Doc Discovery It does just that.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://948702]
Approved by planetscape
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-03-22 02:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (272 votes). Check out past polls.