• 30 Jun

    How to move files to different destinations based on the file extension

    How to move files to different destinations based on the file extension

    Q: Since we are dealing with Pharma equipment where we are pulling data off. We would like to be able to split the data into ‘readable’ (ie Txt, excel) and permanent (ie PDF, Image) and place the file types in different subdirectories on the target. At this time, my only solution would be to create two separate rules to accomplish this. Given that there are so many features hidden in your tool that I keep learning about, I was wondering if that was a feature that is in the Mover that I have not found.

    A: Yes this is possible using our Script option.

    • We used a Windows Folder as Source:

    limagito file mover windows folder as source

    • We added the following Filename Include Filters. These are the file extensions we want to split to different destinations.

    limagito file mover filename filter

    • In this example we added 4 destinations. Each Destination has a unique ID:
      • ID1
      • ID2
      • ID3
      • ID4

    We’ll use this Destination ID in our script.

    limagito file mover destination setup

    • Next, please open our Pascal Script option:

    limagito file mover pascal script option

    • Enable and add the following ‘On Destinations’ Pascal Script:
    Var
      tmpFileExt: String;
    Begin
      psExitCode:= -1;
      // ... add your code here
      tmpFileExt := ExtractFileExt(psFilename);
      // psLogWrite(1, '', 'Check File Extension ' + tmpFileExt + ' from ' + psFilename);
      // Check If Destination ID is ID1 AND do we have a .txt file?
      If (psDestinationID = 'ID1') Then 
        If SameText(tmpFileExt, '.txt') Then
          psExitCode := 1; 
      // Check If Destination ID is ID2 AND do we have .xls/.xlsx files?
      If (psDestinationID = 'ID2') Then
        If SameText(tmpFileExt, '.xls') OR SameText(tmpFileExt, '.xlsx') Then
          psExitCode := 1; 
      // Check If Destination ID is ID3 AND do we have a .pdf file?
      If (psDestinationID = 'ID3') Then 
        If SameText(tmpFileExt, '.pdf') Then
          psExitCode := 1;  
      // Check If Destination ID is ID4 AND do we have .png/.jpg/.bmp files?
      If (psDestinationID = 'ID4') Then
        If SameText(tmpFileExt, '.png') OR SameText(tmpFileExt, '.jpg') OR SameText(tmpFileExt, '.bmp') Then
          psExitCode := 1;       
    End.

    limagito file mover different destinations based on the file extension

    • RunTime Log Result:

    limagito file mover runtime log

    This is is just an example of what is possible. If you need any help with this ‘different destinations based on the file extension’, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

  • 21 Apr

    How to import data into a SQL table where a primary key as guid is needed

    How to import data into a SQL table where a primary key as guid is needed

    Q: I have a question about importing data into a SQL table where a primary key (guid/uniqueidentifier) needs to be generated. In a SQL command like the below, NEWID() will create the required id. Can this be achieved in Limagito?

    limagito file mover sql primary key as guid

    INSERT INTO dbo.testtable(intconID, caseID)

    VALUES (NEWID(), 1)

    Error received:

    8/04/2024 12:37:55 PM TFDPhysMSSQLCommand DB SQL Exception: [FireDAC][Phys][ODBC][Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column ‘intconID’, table ‘dbo.TestTable’; column does not allow nulls. INSERT fails.

    8/04/2024 12:37:55 PM Batch Move Exception: [FireDAC][Phys][ODBC][Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column ‘intconID’, table ‘ dbo.TestTable ‘; column does not allow nulls. INSERT fails.

    A: We added a new feature in version v2024.4.9.0 which replaces the NEWID() in the WriteSQL by a GUID when the Rule is triggered.

    If you need any help with this ‘primary key as guid’ request, please let us know.

    Best Regards,

    Limagito Team

    #sql #managedfiletransfer #FileManagement #filetransfer

    By Limagito-Team SQL , , ,
  • 21 Apr

    Generate Certificate Signing Request (CSR)

    Generate Key and Certificate Signing Request (CSR)

    In version v2024.4.21.0 we added an option to generate a CSR. This is possible using our free Lite+ version too.

    Generate Certificate Signing Request

    • After installation please open our Limagito File Mover Config Tool:

    limagito file mover config tool icon

    • Switch to ‘CSR’ tab
      • The (pre-existing) private key file is optional. If you don’t have this file, we’ll create one for you.
      • Add the necessary details and click Generate
    • You could test the result here: link or link

     

    If you need any help with our new ‘Generate Key and Certificate Signing Request’ option, please let us know.

    Best Regards,

    Limagito Team

    #csr #managedfiletransfer #FileManagement #filetransfer

    By Limagito-Team SIGN , ,
1 7 8 9 10 11 12 13 19
SEARCH