Topic
7 replies Latest Post - ‏2013-11-25T17:51:38Z by cmercier
cmercier
cmercier
6 Posts
ACCEPTED ANSWER

Pinned topic How to include multiple files in RPE document

‏2013-11-20T19:08:08Z |

Would anyone have an example where you would include the contents of all the files in a folder (either a group of Word documents or a group of TXT documents)?

 

All the contents of these documents would form the basis of a larger document.

 

Thanks,

Claude

  • Dragos.Cojocari
    Dragos.Cojocari
    1604 Posts
    ACCEPTED ANSWER

    Re: How to include multiple files in RPE document

    ‏2013-11-21T10:15:59Z  in response to cmercier

    Hey Claude,

     

    one way of doing this is this:

    1. put the list of file names in an xml file with a simple structure

    2. define an XSD for the structure

    3. create a template that iterates the data and for each entry does an INCLUDEFILE

     

    For step 1 you can create a script/app that lists the content of a folder and puts it in the XML file. You can then have RPE run that app automatically by putting it in the pre-command of the docspec.

     

    Regards,

       Dragos

    • cmercier
      cmercier
      6 Posts
      ACCEPTED ANSWER

      Re: How to include multiple files in RPE document

      ‏2013-11-21T16:31:14Z  in response to Dragos.Cojocari

      OK, all that seems reasonable although being a newbie for RPE, I find attempting to implement this a little overwhelming.

      I might, given enough time, be able to create an XML file that has a list of files that I want to process

      However ... I can't find anywhere in the RPE InfoCenter where it would explain how to "iterates the data and for each entry does an INCLUDEFILE".  Everywhere I looked, it mentioned how if you add an Include File, it then prompts you for a specific file.  How do you modify that so as to iterate through a list of file?

      • Dragos.Cojocari
        Dragos.Cojocari
        1604 Posts
        ACCEPTED ANSWER

        Re: How to include multiple files in RPE document

        ‏2013-11-21T16:33:42Z  in response to cmercier

        >>> I can't find anywhere in the RPE InfoCenter where it would explain how to "iterates the data and for each entry does an INCLUDEFILE".

        Putting the include file statement inside a contianer that has a query on it will create the iteration.

         

        >>> Everywhere I looked, it mentioned how if you add an Include File, it then prompts you for a specific file.

        Once you put the inlcudefile element edit its content and instead of the static value use a data/script expression where  you use the data property that gives the XML path.

         

        Regards,

            Dragos

        • cmercier
          cmercier
          6 Posts
          ACCEPTED ANSWER

          Re: How to include multiple files in RPE document

          ‏2013-11-21T18:36:20Z  in response to Dragos.Cojocari

          Dragos,

          Thank you for your prompt replies.  You clearly are well versed in everything RPE!

          (that was the buttering up part prior to requesting a favor ;-)

          Would it be too much trouble to get an example template that does this?  One functioning example would put me well on my way to recreating a former SoDA document that generated a configuration document that was well over 1000 pages.

          I've attached a sample XML file with a list of files

          Thanks,

          Claude

          Attachments

          • This reply was deleted by Dragos.Cojocari 2013-11-25T15:29:07Z. Reason for deletion: broken file
            • cmercier
              cmercier
              6 Posts
              ACCEPTED ANSWER

              Re: How to include multiple files in RPE document

              ‏2013-11-25T15:01:13Z  in response to Dragos.Cojocari

              Thanks so much for doing this Dragos.  Nice to see that you can be buttered up!

              I am having trouble with the attachment though.  I assume that this should be a zip file but when I rename it and try and open the file, I get an error saying that it is not a valid archive.

              Claude

          • Dragos.Cojocari
            Dragos.Cojocari
            1604 Posts
            ACCEPTED ANSWER

            Re: How to include multiple files in RPE document

            ‏2013-11-25T15:29:37Z  in response to cmercier

            ( reposted as original post was deleted since the file was not usable)

            The example has been upload here: FileList Example

            The archive contains:

            • an XML schema based on that strucutre of the XML
            • a template designed to use the XML and insert all the files
            • a test docspec the test XML RPE includes the files by concatenating name of the file to the "dir" value of the filelist.


            Once you've generated the document and open it in Word you will not see any content from the included files. To see the content you have 3 options:


            Regards,

               Dragos

             

            Updated on 2013-11-25T15:41:32Z at 2013-11-25T15:41:32Z by Dragos.Cojocari
            • cmercier
              cmercier
              6 Posts
              ACCEPTED ANSWER

              Re: How to include multiple files in RPE document

              ‏2013-11-25T17:51:38Z  in response to Dragos.Cojocari

              Thank you so much Dragos.

              Works like a charm.

               

              Claude