How-to

  • 12 Jun

    How to copy a raw file if a pdf file with the similar name exists

    Q: How to copy a raw file if a pdf file with the similar name exists. I am trying to have a rule run that when the PDF exists in the folder then to copy our .raw file of a similar name. But if the PDF doesn’t exist that means the run isn’t done yet. So we need it to scan the folder looking for a new pdf if there is one the .raw file will then copy. Right now we run a PowerShell to do the work but maybe there’s a better way.

    A: So this would  mean:
    – Limagito Rule would scan for .raw files
    – If .raw files is found > scan different folder (and subfolders) for .pdf file with similar name
    – If pdf file exists then copy .raw file

    Should be possible, we prepared some screenshots.

    – Source Setup, we used a local Windows folder as Source:

    limagito file mover windows folder as source

    – File Filter Setup:

    limagito file mover file filter setup
    – Open our Pascal Script option:

    limagito file mover pascal script option

    – Enable and add the following ‘On Destinations‘ Pascal Script. Do not forget to adjust the pdf Search Path const, must end with a \

    Var
      tmpFilename: String;
      tmpList: TStringList;
    Const
      ctSearchPath = 'C:\Test\Nova\Pdf\';    
    Begin
      psExitCode:= 0;
      tmpList := Nil;
      tmpFilename := ChangeFileExt(psFileName, '.pdf');
      // ... add your code here
      Try
        tmpList := psListFiles(ctSearchPath, tmpFilename, True);  
        If Assigned(tmpList) And (tmpList.Count > 0) Then
        Begin
          psExitCode := 1;
          psLogWrite(1, '', 'Found ' + tmpFilename + ' in ' + ctSearchPath);
        End
        Else
          psLogWrite(1, '', tmpFilename + ' not available yet in ' + ctSearchPath);
      Finally
        tmpList.Free;
      End;  
    End.

    limagito file mover on destinations pascal script

    – Enable File Memory (we only want to copy the same .raw file once)

    limagito file mover file memory option

    – We used Copy as Function (that is why we enabled our File Memory option)

    limagito file mover function setup

    – Add Destination for .raw files

    limagito file mover destination setup

    – RunTime Log result

    + at our first try the corresponding pdf was not available yet
    + at our second try we found the corresponding pdf file and copied the raw file

    limagito file mover runtime log result

    #filetransfer #mft #filemanagement
    If you need any info  about this ‘similar name exists’ request, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team How-to
  • 14 May

    New counters added in Limagito File Mover

    Newly added in Limagito File Mover recently:

    Values total counters (history):

    • psTotalFiles Counter:  %CSC
    • psTotalFilesSrcError Counter:  %CFS
    • psTotalFileDstError Counter:  %CFD
    • psTotalControlSrc Counter:  %CCS
    • psTotalControlDst Counter:  %CCD

    The following counters will reset themself On Rule Begin:

    • psCurrentsFiles Counter:  %ZSC
    • psCurrentFilesSrcError Counter:  %ZFS
    • psCurrentFilesDstError Counter:  %ZFD
    • psCurrentControlSrcError Counter:  %ZCS
    • psCurrentControlDstError Counter:  %ZCD

    limagito file mover counter parameters

    These can be used for example in email events.

    New counters added and used in email events

     

    Result of sent email:

    New counters added in email example

    These counters are also available as Pascal Script var so this means you can control only to send an error email if for example the value of an error counter reaches a certain value.

    limagito file mover on error event

    Important, enable ‘Use Pascal Script as Event Precondition’ in the options tab:

    use pascal script as precondition in limagito file mover

    You can create any combination of our counters to determine when the error event should actually be sent. Please let us know if you need any help here.

    limagito file mover pascal script as precondition using counters

    An example of the the new counters being used in our Pascal Script ‘On Rule End’ option:

    New counters added in our file mover pascal script option

    RunTime Log Result:

    New counters added in our file mover pascal script option

    #filetransfer #mft #filemanagement

    If you need any info  please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team How-to Pascal Script
  • 11 Feb

    Lower case file rename using regular expression

    Q: We are having some trouble coming up with a proper reg-ex that will rename our files properly, and would like some advice.

    We are receiving files that are named as follows.

    ABCDE_ABC

    We would like to rename them to

    ABCDE_abc

    We have found several reg-ex commands that will do this, but none of them seem to work in the Limagito application. I am sure we have something wrong, but I am unable to find something that will give us the output that we want.

    Do you have any suggestions? Or perhaps an example string?

    Q: Yes this is possible using our File Rename option in your Destination setup:

    • Destination “File Rename” Setup

    Limagito File Mover Destination File Rename Setup

    > We are receiving files that are named as follows: ABCDE_ABC

    > We would like to rename them to ABCDE_abc

    We guess these file have a file extension so you could use:

    Lower Case File Rename RegEx

     

    #FileTransfer #RegEx

    If you need any info about this ‘lower case file rename ’ request, please let us know.

    Best regards,

    Limagito Team

1 2 3 4 5 6
SEARCH