Pascal Script

  • 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

  • 09 Jan

    How to search for a string and replace it with a CRLF

    How to search for a string and replace it with a CRLF

    Q: Is it possible to search for a string and replace it with a CRLF (as we say in windows) [Return]

    The main issue is to replace <br/> with a carriage return Line feed

    A: Yes this is possible by adding the following script:

    • We used a Windows folder as Source:

    limagito file mover Windows folder as source

    • Because we only want to process text files, we added the following include filename filter:

    limagito file mover file filter setup

    • As Destination we added our Pascal Script option, do not forget to adjust the ctOutputPath const:
      • Please add the following script: link
      • This script will replace all <br/> entries by #13#10 (CRLF)

    limagito file mover destination setup

     

    #fileconversion #managedfiletransfer #filetransfer #filemanagement

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

    Best Regards,

    Limagito Team

     

1 2 3 4 5 26
SEARCH