Pascal Script

  • 17 Mar

    How to move files to different ftp folders under the same root

    How to move files to different ftp folders under the same root on the same server

    Q: Conditional destination request. We are looking for an easy way (one channel) to move files to different ftp folders (more than 100 folders) under the same root on the same server, where filename prefix (3 char) is the key to which folder. Prefix and folder name are different.

    A few examples:
    • BBL > folder1
    • ABB > folder2
    • BYR > folder4
    • BYP > folder5
    • DAT > folder6
    I have been looking at your blog post without finding anything like it. The list of prefixes and folders could be a text table in the script or in a csv file. Do you have a script for this?
    A: Yes this is possible, please have a look at the following screenshots. This setup can be used with other Sources and Destinations too.
    – We used a Windows folder as Source:
    limagito file mover windows folder as source
    – Open our Pascal Script option
    limagito file mover pascal script option

    Please enable and add the following ‘On Destination’ Pascal Script:

    • Please add the following script: link
      • The script strips the first 3 characters from the filename by using ‘copy(psFilename, 1, 3)’
      • The stripped part is compared with ‘BBL’, ‘ABB’ .. ‘DAT’
      • Depending on the result of the compare, a folder name is added to our variable psVSA ( pascal script Var String A )
      • This psVSA variable will be used in the Destination setup as parameter (%VSA, which contains data from psVSA)
    • You’ll need to adjust the folder names and add more prefixes if needed
    files to different ftp folders
    – In the FTP as Destination Setup, please adjust the ‘Create Subdir’ option to:   %VSA\%SFS
    • Here we used the %VSA parameter, set in the Pascal Script, which contains the desired subdirectory name
    limagito file mover destination setup
    – Feedback customer:

    That looks easy. Thank you very much.

    If you need any help with this new option, please let us know.

    Best Regards,

    Limagito Team

    #ftp #sftp #managedfiletransfer #filetransfer #filemanagement

  • 25 Feb

    How to move empty subdirectories

    How to move empty subdirectories ( Windows folders only )

    Q: We are looking to create a File Mover rule that scans the source folder for subdirectories that are empty and move them to another destination. Would you be able to assist me in how to best approach this?

    A: This should be possible with a Windows Folder/share as Source and Destination. Remember, this is only needed when no files are being handled, otherwise this can be done using the default options within our file mover tool.

    You’ll only need to add a Source, no need to add a Destination. All is handled within the ‘Pascal Script’ as Source.

    limagito file mover pascal script as source

    • Please add the following script: link
    • Do not forget to adjust the ctSource and ctDestination Path (must end with a \ )
    • The script will scan the ctSource path for subfolders. For each subfolder found, it will check if any file exists. If not, then it will try to create this subfolder in the ctDestinationPath. If this succeeds then the Source subfolder will be removed.

    limagito file mover move empty subdirectories

    If you need any help with this request, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

  • 19 Feb

    How to copy a csv file when a specific row exists

    How to copy a csv file when a specific row exists

    Q: My client is looking for advanced file copy functionality and have set of requirements for this process. Appreciate if you can clarify below requirements applicability with Limagito. The file copying should not copy the currently modified csv files. Basically, the only difference in the files that are completed and in “modify” mode is a last row in the file – If this specific row not exists, file still in “modify” mode.

    A: Yes this is possible. We added two examples (scripts) on how to achieve this.

    1. Example 1: will read the csv file and check all rows for a certain keyword

    2. Example 2: will read the csv file and will only check the last row for a certain keyword

    • We used a windows folder as source:

    limagito file mover windows as source

    • Open our ‘Pascal Script’ option:

    limagito file mover pascal script option

    • Example Script 1 will read the csv file and check all rows for a certain keyword ( RT_Count )
      • Please enable and add the following ‘On Destination’ Pascal Script: link
      • You can adjust the Keyword but always in Uppercase

    limagito file mover pascal script example

    • Example Script 2 will read the csv file and will only check the last row for a certain keyword ( RT_Count )
      • Please enable and add the following ‘On Destination’ Pascal Script: link
      • You can adjust the Keyword but always in Uppercase

    limagito file mover pascal script example

    • As Destination we also used a windows folder:

    limagito file mover windows folder as destination

    • RunTime Log Result:

    limagito file mover runtime log result

    If you need any help with this ‘copy files in a specific order’ request, please let us know.

    Best Regards,

    Limagito Team

    #csv #managedfiletransfer #filetransfer #filemanagement

1 2 3 4 5 27
SEARCH