File Mover Blog

  • 24 Mar

    Move txt files if the line count is more than one

    Q: I am looking to move txt files to a location. If the line count is more than 1 (more than just a header) move to processing.
    A: Yes this is possible using some Pascal Script.

    1. Be sure that you will only handle text files. We’ve added a File Name Include Filter:

    Limagito File Mover Filename Filter

    2.Please open the ‘Pascal Script’ option:

    Limagito File Mover Pascal Script option

    3. Enable and Add the following ‘On Destination’ Pascal Script. You can choose between 0 or -1 as result for psExitCode var. 0 will give an error when such a file is found, -1 will skip such a file.

    Var
      tmpFile: String;
      tmpList: TStringList;
    Begin
      psExitCode:= 1;
      // ... add your code here
      tmpFile := psFilePath + psFileName;
      tmpList := TStringList.Create;
      Try
        Try
          tmpList.LoadFromFile(tmpFile);
          If tmpList.Count < 2 Then
          Begin
            // Invalid count
            psExitcode := -1; // := -1 is Skip File and := 0 is Error on File
            psLogWrite(1, '', 'Invalid recordcount in ' + tmpfile);      
          End;  
        Except
          // Error
          psExitCode := 0;
          psLogWrite(1, '', 'Error loading ' + tmpfile);
        End;
      Finally
        tmpList.Free;
      End;  
    End.
    
    

    Limagito File Mover Line Count is more

    4. RunTime Log

    Limagito File Mover RunTime Log

    #Filetransfer

    If you need any info about this ‘line count is more than’ request, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Pascal Script
  • 23 Mar

    Keep a number of files in a specific delete Folder I’m watching in

    Q: Is there any option for a delete rule to keep a number of files, e.g. keep the last 10 Files, in the specific delete Folder I’m watching in?

    We’re trying to handle our LOG Folder with Limagito. These LOG Files are not written permanently within a specific timeslot so it would be great to have this Log Rotation Option. Maybe there is a scriptsolution?

    A: Yes this is indeed possible with Pascal Script (we tested this with version v2022.3.18.0).

    1.Function is set to Delete

    2.Source must be a Windows Folder or share

    3. Set ‘Source File Sort Order’ to ‘File last write date ascending (Old to New)

    Limagito Source File Sort Order

    4.Open Pascal Script setup:

    Limagito File Mover Pascal Script option

    5.Enable and add the following ‘On Destination’ Pascal Script (you can adjust the Const values of ctKeepFiles, ctSearchExt and ctSearchSubDirs):

    Var
      tmpCount: Integer;
    Const
      ctKeepFiles = 10;
      ctSearchExt = '*.log';
      ctSearchSubDirs = True; // True or False
    Begin
      // ... add your code here
      tmpCount := psCountFiles(psFilePath, ctSearchExt, ctSearchSubDirs);
      // Check
      If tmpCount > ctKeepFiles Then
      Begin
        psExitCode := 1;
      End
      Else
      Begin
        psLogWrite(1, '', 'Skip Delete, Minimum count reached');
        psExitCode := -2;
      End;
    End.
    

    Limagito File Mover keep the last 10 Files

    You’ll find ‘Skip Delete’ in the RunTime Log when the minimum amout of log files needed is reached. Further deletes will be skipped.

    Limagito File Mover RunTime log

    #Filetransfer

    If you need any info about this ‘keep a number of files’ request, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Pascal Script ,
  • 22 Mar

    Google drive v3 api coming to Limagito File Mover

    At this moment we are testing our new Google drive v3 api implementation within Limagito File Mover. Next we would like to add support for Google shared drives (formerly known as Team Drives).

    If you would like to help, this would be much appreciated. Please let us know.

    Limagito File Mover google drive v3 api

     

    #filetransfer #drive

    If you need any info about this ‘Google drive v3 api’ option, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Google , ,
1 45 46 47 48 49 50 51 134
SEARCH