racer_x has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone! This is my first post here so I would be honored to get some of your advice.

I would like to retrieve data from a FileMakerPro database using a perl script. I don't know of a way to do this directly, but that would be a great option if anyone can think of something.

The other idea which I thought of is setting up the FileMaker database with web sharing and using LWP::simple get() with a query URL to simply grab the web page source from the html that the FileMaker server returns. I could make a CDML format page specially 'engineered' for this task so I could make some nice regexp to pull out the info.

So that's my idea, but it's complex and I wanted to know if anyone here can think of an easier way. Thanks!

-E

Replies are listed 'Best First'.
Re: Perl and FileMaker
by TGI (Parson) on Jun 05, 2002 at 05:14 UTC

    If you are just trying to pull static data from filemaker use a tab delimited file or CSV, but if you want to actually pull live data from a filemaker database, use ODBC or XML.

    The current version of FMP can act as an ODBC Server (plugins to do this were available for older versions). If you are running your scripts on a platform where are supported ODBC driver is available (prob'ly windows only, but I'm not sure) you can use Win32::ODBC or DBI and DBD::ODBC to make your perl script act as on ODBC client. Check your manuals or the (surprising helpful) online help. Also read the Filemaker ODBC Primer.

    IIRC, Filemaker Co. was making a big deal about using XML as a data interchange format a few years ago. I believe the web companion can spew XML as well as HTML. It should be easier to extract your data from XML files rather than HTML. Check your docs and this might help, too (it's a big PDF file, save it, and then open it).

    I've been out of the filemaker game for a while, and haven't played with these features. But I know they are available (once upon I time, I yearned for them). It looks like you may even be able to trigger scripts using the ODBC interface.

    Though often maligned, Filemaker is a great tool for the niche it serves. It was fun to check up on it and see how they've changed in the last few years. It looks like they are moving to integrate nicely with 'real' rdms technology, yet maintaining the ease of use that lets a secretary create and manage a functional relational database.


    TGI says moo

      I will give this a shot, thanks for the tips!

      -E
Re: Perl and FileMaker
by abstracts (Hermit) on Jun 05, 2002 at 03:57 UTC
    Hello,

    FileMaker can export your data to a tab-delimeted file (which is fine if all your data does not contain tabs) or to a quoted comma-separated file. Should be fairly straight-forward to deal with that using Text::CSV.

    Hope this helps,,,

Re: Perl and FileMaker
by racer_x (Sexton) on Jun 05, 2002 at 03:40 UTC
    Sorry, the first sentence of my post should have read 'Hello everyone!'

    I have no idea what happened, but that's pretty emabarassing :^)

    -E