• 31 Oct

    How to email a list of filenames after pdf split

    Email list of filenames after pdf split

    Q: I was wondering if there was a way to add the file names from a pdf split to VSA, much like you can when unzipping.

    I’d like to send an email confirmation on completion when pdfs are sent through this workflow. The PDF’s will vary in page counts, and the recipients are non-technical users.

    Below is a log file, from which I’d like to send an email like:

    “the following files have been sent:

    cmg_tabloid_NT_SP1_20231026_001_S.pdf

    cmg_tabloid_NT_SP1_20231026_002_S.pdf

    cmg_tabloid_NT_SP1_20231026_003_S.pdf

    cmg_tabloid_NT_SP1_20231026_004_S.pdf

    cmg_tabloid_NT_SP1_20231026_005_S.pdf

    cmg_tabloid_NT_SP1_20231026_006_S.pdf

    cmg_tabloid_NT_SP1_20231026_007_S.pdf

    cmg_tabloid_NT_SP1_20231026_008_S.pdf”

    Can I add a destination variable like %VSA

    A: We added a new option in our ‘PDF as Destination’ to achieve this, available since version v2023.10.29.0 (29th of October 2023).

    Open (or add) your PDF as Destination:

    limagito file mover pdf as destination

    The new option is available after you add a ‘Output PDF File’ Action:

    limagito file mover output pdf file action

    We enabled ‘Split Pages’ and selected ‘Filename(s)’ as ‘Output successful files to %VSA var’.

    limagito file mover list of filenames after pdf split

    Now you can use the %VSA var in your email setup, it will contain the splitted files when the new option is selected.
    We did a test and this is the email we received when using %VSA as body of the email;
    limagito file mover list of filenames after pdf split
    Feedback customer:
    Thank you for this. The speed that you knock out feature request is unparalleled.

    #pdf #filetransfer #filemanagement #filehandling

    If you need any help with this ‘list of filenames after pdf split’ option, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team How-to PDF
  • 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

  • 28 Oct

    How to execute script on temp folder

    How to execute script on temp folder

    Q: I would like to change the content of a file located on an FTP. I am trying to do so with a python script executed thanks to command option. So, my source is an FTP, and the destination is the same FTP. Is there a way to execute the command script on the temp folder so it would follow these steps :

    1. Move file from FTP to AppData\Local\Temp…
    2. Execute script on the moved file.
    3. Move the edited file to the same FTP.

    I succeed doing it with 2 rules :

    Rule 1 :

    1. Move file from FTP to a local folder.
    2. Execute script on the moved file.

    Rule 2 :

    1. Move file from local folder to the same FTP.

    Thank you!

    A:  It should be possible in one Rule.

    Your Destination setup will have 2 Destination entries. In my example below the second destination is WIN, in your case it would be FTP.
    In the Command setup you can use parameters like %SFP%SFN
    These parameters will point to the Source file located in the temporary folder after download from FTP as Source.

    limagito file mover script on Temp folder

    It is a good idea to adjust the Function setup. We changed the ‘Destination Options’ to ‘Exit Cyclus on Error’. So if the command in the first entry fails it will not move the file to the FTP server. It will retry the Command during the next scan.

    limagito file mover function exit cyclus on error

    #command #filetransfer #filemanagement

    If you need any help with this ‘execute script on Temp folder’ option, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Command ,
1 2 3
SEARCH