2 Replies Latest reply on Jan 29, 2015 7:23 PM by itiming

    How to mirror values in an updating text file to a FM 12 table?

    itiming

      I have an electronic machine writing timing strings to a csv file which looks like this:

       

      TimerOutput File:

      CT01_13,1,TEST,1234,08:53:32.94,1,109DDD,4

      CT01_13,2,TEST,22,08:53:32.64,1,109DDD,8

      CT01_13,3,TEST,11,08:53:35.82,1,109DDD,4

      CT01_13,4,TEST,1234,08:53:38.94,2,109DDD,2

      CT01_13,5,TEST,22,08:53:39.73,2,109DDD,8

      CT01_13,6,TEST,6,08:53:38.13,1,109DDD,2

      CT01_13,7,TEST,1234,08:53:44.92,3,109DDD,4

      CT01_13,8,TEST,40,08:53:44.81,1,109DDD,2

      CT01_13,9,TEST,22,08:53:47.68,3,109DDD,4

      CT01_13,10,TEST,11,08:53:47.14,2,109DDD,1

      CT01_13,11,TEST,18,08:53:49.77,1,109DDD,1

      CT01_13,12,TEST,7,08:53:49.85,1,109DDD,1

       

      Each time an event occurs, another line of text is written to this text file.

      Over a day, there will be 500 to 50,000 text strings added to this file.

       

      To begin, I am manually importing the file with these text strings into a RawData field created in my FileMaker 12 table.

       

      Then, after a while, when more records have been added to the TimerOutput file, I make the next import looking for only the newly created (since my prior import) records and import those.

       

      I would like to work out an automated way to mirror the records as they are written into the text file to records in a Filemaker table.

       

      As a first try, I imported the subsequent TimerOutput file into Filemaker using the "Create New Table" on import.

      Then I have two table occurrences in Filemaker; one is the full TimerOutput file (which gets replaced with each import); the other is my working set of records that gets updated by adding new records from the full file.

       

      The markers I can use to check for new records are the 2nd field (serial number) and the 4th field (time); which both increase through the day.

       

      BTW, the text strings can be output via a direct socket connection if anyone could suggest a protocol/method to connect with FM 12.

       

      Thank you for any advice on an automated approach.

        • 1. Re: How to mirror values in an updating text file to a FM 12 table?
          siplus

          The way this is set up creates a lot of redundant and useless work.

           

          If you could have the electronic machine stop writing to the same file from time to time and create another, new file, everything would be much easier.

           

          We do have a similar situation at a client - there's a weather machine outputting a csv data file with 5 - 100 lines every 30 minutes to a ftp location. The filemaker database connects to the ftp site (we're using the 360Works FTPeek plugin for this), gets the directory, downloads every file and then deletes each downloaded file from the ftp directory. Every file is read into a text field of a new record in an import table, then the text field is processed (and split into single records, into another table). The import record is marked as "processed". Everything works flawlessly, no checking needed.

           

          Maybe you can recreate such a scenario ?

          • 2. Re: How to mirror values in an updating text file to a FM 12 table?
            itiming

            Thank you for the recommendation. Yes, it is much less complicated to update/add to my local FM file when the source file writing is suspended periodically. I can make this happen; so that on import, only newly created records are added.

             

            I am thinking that my goal will be to have a solution which scripts passing the records from the source via a socket connection to my FM table. Not sure which scripting language would suffice.