File Mover Blog

  • 22 Aug

    Subdirectory Name Filter (Source = WIN)

    Let’s use an example to make things more clear.

    * Source Path: C:\Input\

    Folders available in Source Path:

    C:\Input\
    C:\Input\SubDir1
    C:\Input\SubDir2
    C:\Input\SubDir1\SubDir11
    C:\Input\SubDir2\Subdir21

    If we only want to include files from let’s say C:\Input\SubDir2 then we need to add the following filter to the ‘Include Subdirectory Name Filter’:

    SubDir2

    If we want to include files from C:\Input\SubDir2 and it’s subdirectories then we need to add the following filters to the ‘Include Subdirectory Name Filter’:

    SubDir2
    *\SubDir2\*

    By Limagito-Team Parameters
  • 18 Jul

    LimagitoX Pascal Script Example

    We get a lot of custom requests. We can’t add them all to LimagitoX File Mover so that is why the Pascal Script option was added.  To understand the possibilities of Pascal Script we will add some cases to our blog. Please feel free to ask us about the Pascal Script possibilities.

    Customer Request:

    Secondly, the destination for the moving rule is in two seperate locations. Essentially, files from 1-5000 need to go to one location and files over 5001 need to go to another. Is this a job for pascal script? If so do you know of any good tutorials on how to write it? The files are named 1Filename, 2Filename … all the way to 5000Filename

    Our solution was the following:

    Add two destinations:
    – files from 1-5000 need to go to one location => FIRST DESTINATION
    – and files over 5001 need to go to another. => SECOND DESTINATION
    Add the following ‘On Destinations’ Pascal Script:
    var
      i: integer;
      tmpInt: Integer;
      tmpStr: String;
    Begin
      psExitCode:= 0;
      // … add your code here
      tmpInt := -1;
      // Get Number Prefix
      for i := 4 downto 1 do
      begin
        tmpStr := LeftStr(psFilename, i);
        try
          tmpInt := StrToInt(tmpStr);
        Except
          //
        End;
        If tmpInt <> -1 Then
          Break;
      end;
      // Check Number Prefix
      If tmpInt <> -1 Then
      Begin
        If (tmpInt <= 5000) And (psDestinationID = ‘ID1’) Then
          psExitCode := 1;
        If (tmpInt > 5000) And (psDestinationID = ‘ID2’) Then
          psExitCode := 1;
      End
      Else
        psLogWrite(2, ‘[Prefix Number Check]’, ‘Not a valid prefix, ‘ + psFilename);
    End.

     

    By Limagito-Team Pascal Script
SEARCH