5 Replies Latest reply: May 15, 2014 10:08 AM by Tim Racht RSS

    Filenames

    Tim Racht

      I have a monitored process that uses 5 different files (companies) all with the same name of the report.  They are each located in a different directory by company.  Since I have them in a monitored process I set them up to move the files to another location.  Upon moving these files, one overwrites the next and the end result is the last report is the only report that is saved.  How do I move all files in one directory with separate names?  Is it possible to move each file into a separate directory with the original name of the file?

        • Filenames
          Olly Bond

          Hello Tim,

           

          Input distributions should allow you to add variables to the filenames, so
          inpath\comp-a\report.txt could be moved to
          outpath\report-20100719.txt. But if your process takes all five files, and runs at one time, a timestamp won't help.

           

          Assuming the files are text reports, one option might be to make an export distribution of the report as part of each Monarch project? Then DataPump could just use "delete" as the input distribution.

           

          I'm assuming that the process uses five projects - it might be trickier for a single project that uses five input reports. I'm sure there's a more elegant scripted solution out there...

           

          Best wishes,

           

          Olly

            • Filenames
              RalphB _

              Tim, going along Ollys line of thought, instead of appending a date stamp on the file, append the company identifier to the file name.  So in the end you'd end up on the order of
              outpath\Company-A_Report.txt or something like that.

                • Filenames
                  Tim Racht

                  This is a single project that uses five different reports of the same name, just located in different directories.

                    • Filenames
                      Olly Bond

                      Hello Tim,

                       

                      One option would be to have a null project that opened one report, performed no exports, and had an input distribution that renamed the report to
                      newpath\comp-a.txt. Repeat for the other four input files, then use your real project to open the
                      newpath\comp-x.txt files and proceed.

                       

                      Hope this helps?

                       

                      Best wishes,

                       

                      Olly