File Mover Blog

  • 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

  • 18 Feb

    How to copy files in a specific order to the correct location

    How to copy files in a specific order to the correct location

    Q:  Here is the challenge:

    1. Copy job files  (3 total)  in a specific order to the correct location.
    2. There are 3 file formats:
      • XML
      • USF
      • JPG
    3.    The XML must be copied first,  followed by the JPG and finally the USF.

    Is this something you can help with?

    A: Yes this would be possible with our tool. In version v2024.2.18.0 we added an option to achieve this.

    Our idea is to use 3 Rules (tasks):

    • Rule 1: Will copy the the files from the source into temporary subfolders with the name of the file without its extension.
    • Rule 2: Will check if all three files are available and copy them in a specific order to the destination.
    • Rule 3: Will do the cleanup of the temporary folders we used.

    limagito file mover rule listing

     

    Rule 1:

    • We used a Windows folder as source:

    limagito file mover windows folder as source

    • “Filename Include Filter” is to only include xml, usf and jpg files:

    limagito file mover filename filter setup

    • We enabled our file memory option so we’ll only handle the same source files once:

    limagito file mover file memory option

    • Function is set to “Copy” so the original files stay at their source:

    limagito file mover function setup

    • As destination we used a Windows folder:
      • This temporary Destination folder will be used in the ‘On Destination’ Pascal Script of Rule 2.

    limagito file mover windows folder as destination

    • We’ll copy the source files into subfolders with the name of the source file without its extension. This way a job consisting out of three files will reside with one subfolder.

    limagito file mover destination subfolder setup

    Rule 2:

    • The new option to achieve this request is available under our “Schedule Setup”. Switch to “Advanced” tab:
      • Select ‘Root filepath & extension descending (Z to A) – Reset Exit Output on filepath change’
      • Enable ‘Exit Output to Destination On Error’

    limagito file mover copy files in a specific order

    • As source we used a Windows folder but important, the folder itself is a parameter, %VSA
      • Don’t mind if it is marked red, this is because the parameter is empty during the setup.
      • This %VSA parameter will be used in our ‘On Rule Begin’ Pascal Script option.

    limagito file mover windows folder as source

    • Please open our ‘Pascal Script’ option:

    limagito file mover pascal script option

    • Enable and add the following ‘On Rule Begin’ Pascal Script:
      • Please add the following script: link
      • Don’t forget to adjust the ctScanPath Const. This path must be the same as the Destination folder of Rule 1.
      • The script will scan the temporary root folder for subfolders, these subfolders are added to our psVSA var (= %VSA parameter).

    limagito file mover on rule begin pascal script

    • Enable and add the following ‘On Destination’ Pascal Script:
      • Please add the following script: link
      • This script will check if all three files (xml, usf and jpg) of a job are available.

    limagito file mover on destination pascal script

    • We enabled our file memory option int the second Rule also because we want to handle copy errors:

    limagito file mover file memory setup

    • Function is set to ‘Copy’:

    limagito filemover function setup

    • As Destination we also used a Windows folder:

    limagito file mover destination setup

    • RunTime Log result:
      • There is a missing file for Job ‘TestFile2’, so we’ll retry this one during the next scan.
      • All three files are available for Job ‘TestFile’, so all three files are copied in the specific order as requested.

    limagito file mover runtime log result

    • Source folder of Rule 1:

    limagito filemover examples

    • Destination folder of Rule 1:

    limagito filemover examples

    • Destination subfolder of Rule 1:

    limagito filemover examples

    • Destination subfolder of Rule 1:

    limagito filemover examples

    • Destination folder of Rule 2:

    limagito filemover examples

     

    Rule 3:

    • Will handle the cleanup of the temporary folder we used: C:\Test\EDemo\Tmp

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

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Filters
  • 16 Feb

    How to use parameters within the regex rename option

    How to use parameters within the regex rename option

    Q:  have a case where I’m getting several files from a folder. I’m getting the following files with my filter:

    20240212_P2.pdf

    20240213_P2.pdf

    Where 20240212 represents the date. I’m wanting the files output it to so they are consecutive pages on the same day:

    20240213_P1.pdf

    20240213_P2.pdf

    In my file rename in the destination, I know that I could do something like (20240212)_([A-Z]\d+).pdf in the regex so I can accurately match the file, but it would be really cool if I could use (%TCD:mmddyyyy)_([A-Z]\d+).pdf with the parameter being used as a literal to match on, but I know Limagito is not setup to do that. This is more of a feature request as it would make it really useful.

    Thanks for all you guys do!

    A: We added a new option in v2024.2.16.0 to allow this. This is an advanced option, so it is a bit ‘hidden’.

    • Schedule button > Advanced Tab > “Allow Params In RegEx Renaming”:

    parameters within the regex rename option

    • File rename example using parameters within the RegEx field:

    limagito file mover file renaming using regex

    If you need any help with this ‘parameters within the regex rename option’ question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Rename , ,
1 2 3 4 5 6 7 8 136
SEARCH