How-to

  • 29 Oct

    How to filter file from read content in file header data

    Q: How to filter file from read content in file Header data date=today yyyymmdd

    A: We received an example of the file we need the content from. The filename of this text file stays the same, it is being updated each day by the customer.

    This is an example of the content of this file where we need to read ‘RUNDATE=’ value and use it as ‘Include File Filter’.

    limagito file mover filter file from read content
    In our test setup we used a Windows folder as Source and Destination. Source and Destination can be any type. The text file where we need to read the content from and use it as filter must be located on a Windows folder or Share.
    limagito file mover test environment
    Subfolders Test Environment:
    – Data: contains the text file we will check for the ‘RUNDATE’ entry that will be used as file filter.
    – In: Files to be moved
    – Out: Destination of files
    Please open our ‘Pascal Script’ option:
    limagito file mover pascal script option

    Enable and add the following ‘On Rule Begin’ Pascal Script. I’ve attached the script (script.txt). Don’t forget to adjust the ctTxtFile Const to your actual setup. The script will load the text file when the Rule is triggered, it will strip the part after ‘RUNDATE=’ and will set this to our %VSA variable that will be used in the FileName Include Filter setup.

    Var
      iList: Integer;
      tmpEntry, tmpFile: String;
      tmpList: TStringList;
    Const
      ctRunDate = 'RUNDATE=';
      ctTxtFile = 'C:\Test\Customer\Data\fxrate0000_getdata.txt';
    Begin
      psVSA := '';
      psExitCode:= 0;
      tmpFile := ctTxtFile;
      psLogWrite(1, '', 'Searching for filter from File: ' + tmpFile);
      tmpList := TStringList.Create;
      Try
        Try
          tmpList.LoadFromFile(tmpFile);
          // Iterate
          For iList := 0 to (tmpList.Count - 1) Do
          Begin
            tmpEntry := AnsiUpperCase(tmpList.Strings[iList]);
            If pos(ctRunDate, tmpEntry) <> 0 Then
            Begin
              tmpEntry := psStringReplace(tmpEntry, ctRunDate, '');
              If tmpEntry <> '' Then
              Begin
                psVSA := '*' + tmpEntry + '*';
                psExitCode := 1; // Filter found
                // Debug
                psLogWrite(1, '', 'File Filter adjusted to: ' + psVSA);
                // Break
                Break;
              End;
            End;
          End;
         Except
           psLogWrite(1, '', 'LoadFromFileError, ' + tmpFile);
         End;
      Finally
        tmpList.Free;
      End;
    End.

    limagito file mover pascal script option
    Add the following File Filter Setup:
    limagito file mover file filter setup
    Important, do not forget to enable ‘Allow parameters in File Name Filter’:
    limagito file mover file filter advanced options
    Now enable and trigger the Rule. RunTime Log Result:
    limagito file mover runtime log result

    #filehandling #filetransfer #filemanagement

    If you need any help with this ‘filter file from read contents’ request, please let us know.

    Best Regards,

    Limagito Team

  • 18 Jul

    How to copy files from an FDA regulated equipment without modifying

    Q: We are trying to run a copy of files from an FDA regulated equipment to an external NAS. That part we’ve got down. Works great.  The item that I have not figured out is that since these are regulated devices. Files cannot be modified. If they are, there’s an issue. Is there a way so that if a file has been modified on the source, it is NOT copied to the destination NAS with the same name, but instead is copied with a rename function tied to is (such as extending the name with ‘changed-yyyymm hhmm’) or similar.   Newly created files, would be copied with their original names in place. Only modified/changed flies would be renamed. Would this have to be a second copy rule or can we do all of this within one. Thanks for the assistance.

    A: this option is available under the “File & Directory” tab of your Windows as Destination setup:

    • Please adjust “File Options” to: “Add dot datetime (pre-ext) suffix if exists”. DateTime suffix format will be YYYMMDDHHNNSS.
      • This “Add dot datetime (pre-ext) suffix if exists” option was added in v2023.7.10.0

    limagito file mover FDA regulated equipment

    #mft #filetransfer #filemanagement

    If you need any info about this “FDA regulated equipment” question, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team How-to WIN ,
  • 25 Jun

    How to transfer a single file even if multiple files match the file filter

    Q: Is there a way to limit Limagito to only transfer a single file even if multiple files match the file filter? I am looking to rate limit our upload of specific files. Instead of uploading them all at once, I just want to upload one every 30 minutes.

    A: This is possible. Please open the “Schedule” setup  and set “Max. Files processed in One Scan” to 1. Use the “Timer” or “Scheduler” and set it to every 30 minutes.

    limagito file mover schedule option

    #Filetransfer #mft

    If you need any info about this request, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team How-to
1 2 3 4 5 6 7
SEARCH