3 Replies Latest reply on Aug 21, 2009 11:40 AM by comment_1

    Trailer Total Record in Export File

    DogSavior

      Title

      Trailer Total Record in Export File

      Post

      I am very new to FileMaker and would like to know the easiest way to add a trailer record (only contains a "T" and the calculated field that counts the number of records in my export file) to the end of my export file?  The export file is a flat text file which I created by concatenating all my fields together and exporting the one field in a tab delimited file.  I just can't figure out how to get one last record added to the end of my export file. Thanks for any help.

        • 1. Re: Trailer Total Record in Export File
          philmodjunk
            

          Perhaps you could create a "dummy" record with just the text/values you need for export. You could either script the creation/deletion of this record for each export, or "hide" it from the user when not exporting and just update it prior to each export.

           

          You would set things up so that this record sorts to the bottom of your found set.

           

          I say "perhaps" because the design/uses of your table may make this suggestion impractical.

          • 2. Re: Trailer Total Record in Export File
            etripoli
               I've acheived something similar, but it requires using 'Export Field Contents...' instead of just 'Export...'.  You'll need to build the export file record-by-record, field-by-field, using the ¶ symbol to separate lines, and using a copied tab character, or comma, as the delimiter.  Create a global field in your table, and a script to loop through the records, adding the fields to the global, and finishing by adding the ¶ "T " & get ( foundcount).  Then export the contents of this field.
            • 3. Re: Trailer Total Record in Export File
              comment_1
                

              Dog Savior wrote:

              The export file is a flat text file which I created by concatenating all my fields together and exporting the one field in a tab delimited file.


              The best way to do this is export as XML, with a custom XSLT stylesheet. The stylesheet can concatenate your fields, add header and/or trailer, even count your records - all this without adding any overhead to your file.

               

               

              Building the entire file in a global field and exporting it using Export Field Contents… is  also possible - but keep in mind that the exported file will be UTF-16 encoded, which the target application may not be able to handle.

               

               

              Finally, you could import your records into a temp table, and add a dummy record there (the idea of adding a dummy record to your real data makes me shudder).