5 Replies Latest reply on Jan 17, 2014 2:41 AM by beverly

    Generate txt file in schedule script

    aanshi

      I m trying to export records as txt file. This script is schedule on server.In export records there is no option for txt file. if I choose output file as .tab in file path If I give e.g "d:/test/test.txt" than in generating file its gives tab . How to generate txt file purely.

        • 1. Re: Generate txt file in schedule script
          mikebeargie

          Server paths do not support a path like that. You can only export to the documents directory.

           

          Try using a path such as this:

          "file:" & get(documentspath) & "test.txt"

           

          and check your server filemaker documents folder (program files/Filemaker/server/data/documents or something like that).

          • 2. Re: Generate txt file in schedule script
            beverly

            If you have multiple fields in the "export", yes you will get the tab character. If, however, you have ONE field with the data and export as .tab, you only get the return-between-records/rows.

             

            You don't specify what you want between fields (if multiple). What would you expect there to be?

            Perhaps these articles of mine on the FileMakerHacks blog would help:

                 <http://www.filemakerhacks.com/filemakerhacks/6045>

                 <http://www.filemakerhacks.com/filemakerhacks/5616>

             

            Beverly

            • 3. Re: Generate txt file in schedule script
              aanshi

              I want to export records as txt file.But there is no directly option for txt ..I used this get(documentspath) & "test.txt" but in option .tab this is by default selected .so in generating txt file its shows vertical tab .I wantr to remove this

              • 4. Re: Generate txt file in schedule script
                jrenfrew

                Listen to Beverly as she is wise..... and read those blog posts

                 

                A CSV file and a TAB file and an MER file and an XML file ARE text files, so is a TXT file. Possibly.

                That is how we can open CSV files in text editors all the way down to Notepad on a PC

                And you can change the suffix part of a file to call it something different which is a very different thing to changing the content type. You can call a PDF file something.txt and you can indeed open it in a text editor as it is JUST text. That does not however mean you will be able to make sense of the contents, as the text it contains is in fact a set of dictionaries and in structions.

                 

                There is, as Beverly points out no way to dump multiple fields from a record without there being a separator between data values. in the case of TAB it is indeed a TAB ( and I for one am glad it is that consistent ) and for CSV it is a comma, given that csv stands for comma separated values.

                 

                IF you want a single line of text from several fields you need to create a FieldD which is exactly that. FieldA & " " & FieldB & " " & FieldC. Either as a calulated field or from a script.

                 

                The you can export that single field to DocsPath & "test.txt", tell Filemaker it is a tab file (or a csv file ) with this name and you will get what you are looking for. Single line of text for EACH record in the found set.

                • 5. Re: Generate txt file in schedule script
                  beverly

                  What separator/delimiter do you expect between FIELDS? If you only have one field and one or many records, .tab is perfectly ok with no TABs. Did you read my articles?

                   

                  You may also achieve what you want with plugin.

                   

                  You must give an example of what you are exporting and what you think it should look like. Then there are ways to to this!!

                   

                  -- sent from my iPhone4 --

                  Beverly Voth

                  --