Need assistance with modifying XML 1.0 document

williamstechnologygroup used Ask the Experts™
trying to figure out how to modify an xml version 1.0 script to allow several files to be picked up by an ftp server. We have a current script in place that was created many years ago.. we haven't have to change it but now have the need.
Here is the script below... what I am trying to do is get the last documents (pull file 3 and 4) to actually recognize and pull the files. The file names are also listed below...

<?xml version="1.0" encoding="utf-8" ?>

NOTE: CU Contact Info


 <!-- NOTE: ftp dirs lowercased-->


        <add key="archiveDays" value="60"/>
        <add key="archiveDirectory" value="archive"/>

      <!-- FTP Server INfo -->
        <add key="FTPServer" value="" />
        <add key="FTPUN" value="confidential" />
        <add key="FTPPwd" value="confidential" />
        <add key="FTPPort" value="22" />

        <!-- Log file info -->
        <add key="LogFile" value="\\blgappserv1\infinity\CreditUnionFTP\work\logs\BLGFeed.log"/>

        <!-- To/From paths-->
        <!-- <add key="networkRootDirectory" value="P:\PCFS\" /> -->
        <add key="networkRootDirectory" value="\\blgdcserv1.blg.local\data\PCFS\" />
        <add key="networkSourceDirectory" value="Exports" />
        <add key="networkDestinationDirectory" value="Imports" />

        <add key="ftpSourceDirectory" value="export" />
        <add key="ftpDestinationDirectory" value="import" />

        <!-- NOTE: These are the files we expect to send to each Credit Union    -->
        <!--       The expectation is they are named the same except for CU Name -->
      <!-- NOTE: We took off file extensions from some of these files, as they
               were not consistent across all credit unions                   -->
        <!-- ==================================================================  -->
        <add key="sendFile1" value="%short% CIF File%date%" />
        <add key="sendFile2" value="%short% GL File%date%" />
        <add key="sendFile3" value="%long% 1502%date%%time%.pdf" />
        <add key="sendFile4" value="%long% DAR%date%%time%.pdf" />
        <add key="sendFile5" value="Trial Balance %short%%date%%time%.pdf" />
        <add key="sendFile6" value="1502 %short%%date%" />
        <add key="sendFile7" value="Delinquent Report%date%.pdf" />
      <add key="sendFile8" value="%short% Zero Balance%date%.pdf" />
      <add key="sendFile9" value="%short% payment history%date%.csv" />

        <!-- NOTE: These are the files we expect to pull From each Credit Union  -->
        <!--       The expectation is they are named the same except for CU Name -->
        <!--       * The extension is different per credit union, so we can't    -->
        <!--         count on it.                                                -->
        <!-- ==================================================================  -->
        <add key="pullFile1" value="%short%PMT%date%*" />
      <add key="pullFile2" value="CJCUPMT_%date%*" />
      <add key="pullFile3" value="BLG-Daily-Activity-Report- *.*" />
      <add key="pullFile4" value="1445.LOANPMTACTV- *.*" />


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®




just attached a screen shot of the actual file names that we are trying to pull from the ftp server..
all of the previous files that work have a date format of 111919 for example.. no dots between and no 4 character year. That is why %date% works on those files.. but does not work on the last 2 files. We also cannot rename the incoming files either before they hit our ftp server......


used *.* in my feeble attempt to get it to work, but I don't think XML uses wildcards?
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Most Valuable Expert 2018
Distinguished Expert 2018
XML is not a script. This is a configuration file for a script or an application that handles the FTP transfer based on the settings in the XML.
Based on the other entries, * or *.* should work to pull all files matching the pattern; the issue above is that you have a space between the "-" and the "*.*", so there's no match: "BLG-Daily-Activity-Report- *.*"
Try it like this:
      <add key="pullFile3" value="BLG-Daily-Activity-Report-*.pdf" />
      <add key="pullFile4" value="1445.LOANPMTACTV-*.TXT" />

Open in new window


Thanks! I will give this a try... since tomorrow is Thanksgiving, they will not know until Friday whether this works as the script runs at 7am each day... I will let you know!!
Looks like this worked! thanks for your help!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial