1 Reply Latest reply on May 29, 2009 9:05 AM by TSGal

    Insert File reference based on a Specific Field



      Insert File reference based on a Specific Field


      I have a database of over 2000 records for a tape library.   Each record has a field for a tape number.  I need to associate separate files for individual tape logs that are in one of three different formats (DOC, PDF, and FP7).  I can do this manually by inserting a file reference in a container but was trying to work out a script to automate things.   I been unable to find a solution by using the Tape number to parse a folder for the specific file with the number as part of it's file name.     Here is an example - FM Tape # field = 64,   reference file = Log #64 ATM.  All referenced files names are somewhat standardized to start with LOG #. The filename data that follows that is not same for all files.


      Is it possible or am I stuck doing this manually for 2000 records?



        • 1. Re: Insert File reference based on a Specific Field



          Thank you for your post.


          You could create a calculation field that searches for "Log #" and if exists, grab everything that follows the "#" character.  Assuming your field is entitled "Tape Number", create a calculation field, CALC, with the formula:


          If ( PatternCount ( Tape Number ; "Log #" ) > 0 ; Right ( Tape Number ; Length ( Tape Number ) - Position ( Tape Number ; "Log #" ; 1 ; 1 ) - 4 ) ; "" )


          You could also put this in a script and place the result in another field.


          If you need clarification for any of the above functions, let me know.



          FileMaker, Inc.