• 11 Jul

    Generate an xml on output with the same name as the input filename

    Q: I was wondering if Limagito File Mover can generate an xml on output with the same name as the input filename.

    A: Yes this is possible. In this case we’ll add a second Destination. This ‘Pascal Script’ Destination will create the Xml file. It will only generate this xml if the first Destination succeeds.

    1.You can use any Source. In our example we used a Windows Folder.

    2.We only want write the Xml file if the first Destination Succeeds. Therefore we have to select ‘Destination Memory & Exit Cyclus On Error’ as Destination Option in the Function Setup.

    Limagito File Mover Function Setup

    3. Add Pascal Script (PScript) as Second Destination

    Limagito File Mover Pascal Script as Destination

    4. Pascal Script Destination Setup

    We received the following example xml from the user (but we can generate other xml structures too):

    <?xml version=”1.0″ encoding=”iso-8859-1″?>
    <AdWatchData>
    <adwatch-ad-number>HOU4001521801</adwatch-ad-number>
    <file_name>HOU4001521801.pdf</file_name>
    </AdWatchData>

    We created the following Pascal Script which will generate the xml file. Please don’t forget to adjust the ‘ctOutputPath’ Const which will be different in your case. In our example we’ll create the xml file in: ‘C:\Test\Out\’.

    Limagito File Mover generate xml on output

    Var
      tmpFileExt: String;
      tmpFileName, tmpFileNameNoExt: String;
      tmpXml: TStringList;
    Const
      ctOutputPath = 'C:\Test\Out\'; // must end with a \
    Begin
      psExitCode:= 0;
      tmpFileExt := ExtractFileExt(psFileName);
      tmpFilenameNoExt := psStringReplace(psFileName, tmpFileExt, '');
      tmpFileName := tmpFileNameNoExt + '.xml';
      // Create XML
      tmpXml := TStringList.Create;
      Try
        tmpXml.Add('<!--?xml version="1.0" encoding="iso-8859-1"?-->')
        tmpXml.Add('');
        tmpXml.Add('' + tmpFileNameNoExt + '');
        tmpXml.Add('' + psFileName + '');
        tmpXml.Add(''); 
        // Save to File  
        Try
          tmpXml.SaveToFile(ctOutputPath + tmpFileName);
          psExitCode := 1;   
        Except
          psLogWrite(1, '', 'SaveToFile Error, File: ' + ctOutputPath + tmpFileName);
        End;
      Finally
        tmpXml.Free;
      End;  
    End.

    5.RunTimeLog Result:

    Limagito File Mover RunTime Log

    6. Generated Xml on Output:

    Limagito File Mover generate xml on output

    #FileTransfer

    If you need any info about this new ‘Generate an xml on output’ option, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team XML ,
  • 10 Jul

    Google Cloud Storage as Destination in Limagito File Mover

    Google Cloud Storage as Destination was added in Limagito File Mover version v2021.7.8.0. In the following example we’ll upload a File to Google Cloud Storage.

    1.First we added a Windows folder as Source:

    Limagito File Mover Windows Folder as Source

    2. Next we added ‘Google Cloud Storage (G Cloud)’ as Destination:

    Limagito File Mover Select Destination

    3.We want the files to be copied into the ‘/Test’ folder of Bucket ‘limagito’. At the moment we use the ‘Service Account JSON Private Key’ as authentication. You need to generate this in your Google Cloud Setup and after download import this JSON file using the Import Button.

    Limagito File Mover Goolge Cloud Setup

    Google Cloud Storage Service account key JSON file

    Don’t forget to set the Bucketname. In our case it is called ‘limagito’.

    Limagito File Mover Goolge Cloud Bucketname Setup

    Hit ‘Connect’ to test the connection:

    Limagito File Mover Google Cloud Storage Connection test

    4. RunTime Log Result:

    Limagito File Mover RunTime Log Result

    5. Result in the Google Cloud Storage Browser:

    Limagito File Mover Cloud Browser Result

    #FileTransfer

    If you need any info about this new ‘Google Cloud Storage as Destination’ option, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Google
  • 09 Jul

    List of filename parts to move in a text file with Limagito File Mover

    Q: Is it possible to have a list of filename parts in a text file and use this to move any files whose name matches the whole filename or part file name in a directory? I’ve had a look on the blog but I think that is only for 1 file using a part filename.

    A: In version v2021.7.9.0 we added a new option to achieve this. We added some screenshots to get you started.

    1. Windows Folder as Source. This folder will contain all files. We’ll filter them using information from a seperate text file.

    Limagito File Mover Source Setup

    Our Source folder contains 244 files:

    Limagito File Mover Source Files

    2.Next, please open the Rule Parameters option of this Rule.

    Limagito File Mover Rule Parameters

    Select the text file containing the filename parts we’ll use to filter the files we want to copy. We selected ‘On Rule Begin’ as Load File Mode, so the content of this text will will be reloaded on each Rule Begin. We also enabled ‘Reload only when file content changes’ to prevent unnecessary loading of this file.

    Limagito File Mover File Content Setup

    Content of the text file we’ll use to filter the files we want to copy, it contains parts of filenames.

    Limagito File Mover File Parts as Content Filter

    3. Open the File Filter setup and select ‘File Contents > Include’ Tab. Enable the new option called ‘Add wildcards to File Content Entries in search’.

    When enabled wildcards will be added to each entry of the file content (in memory) during the search.
    i.e.
    Suppose file name found in source folder would be: test.pdf
    And the include FileContent would contain: test
    With this option enabled the file would be picked up because we will check test.pdf with *test*

    Limagito File Mover File Filter Setup

    4. As Destination we also added a Windows Folder:

    Limagito File Mover Destination Setup

    5. RunTime Log Result. Of  the original 244 files in the Source folder, 216 were copied due to the File Content Filter.

    Limagito File Mover RunTime Log Result

    #FileTransfer

    If you need any info about this new ‘List of Filename parts’ option, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Filters , ,
1 7 8 9 10 11 12 13 17
SEARCH