File Mover Blog

  • 06 Dec

    How to add a record to a csv file

    How to add a record to a csv file

    Q: I have a job which is processed through another bit of software, I get 1 file in and at the end of the process, I can have over 100 data files.

    I need to add a record to the start of each file with the same structure, the fields can be empty but I do need to populate 2 of the fields.

    • Sequence fields needs to be 000000
    • Outname fields needs to be the name of the data file

    I then need to add a record at the end of the file but only 1 field needs to be populated

    • Sequence = 999999

    Is this achievable in Limagito? I can do this within the software that processes the data but it will be a very long process to set up.

    A: This should be possible using our scripting option.

    • We used a Windows folder as Source:

    limagito file mover windows folder as source

    • We added the following Include Filename filter because we want to be sure we only are going to handle csv files:

    limagito filemover filename filter

    • As Destination we used our PScript (Pascal Script) option:

    limagito filemover destination setup

    • Please add the following Pascal Script
      • Please add the following script: link
      • Do not forget to adjust the ctOutputPath ( path must end with a \ )
        • This is the path where the adjusted csv files will be saved

    limagito file mover add a record to a csv file

    • Example content of csv source file before changes:

    limagito filemover csv example file

    • Example content of csv destination file after changes:

    limagito file mover example csv file

    Feedback customer:

    You are an absolute legend. Thank you very much

    If you need any help with this “add a record to a csv file” question, please let us know.

    Best Regards,

    Limagito Team

    #csv #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team CSV Pascal Script ,
  • 21 Nov

    How to to skip files if they already exist at the destination

    How to to skip files if they already exist at the destination

    Q: I’m looking to setup a nightly schedule that will copy files from source to destination.  Is there a way to skip files if they already exist at the destination?

    A: If you start with a fresh setup, meaning no files available in the Destination when you first trigger the Rule then we really recommend our ‘File Memory’ option. This way our tool remembers which files were already copied to the destination and this is also the fastest way.

    skip files if they already exist

    If some destination files already exist then you could fill the File Memory database first. This is only possible with [WIN] as Source!

    1.Enable ‘Enable File Memory’ option (previous screenshot). This option must stay enabled.

    2.Enable ‘Skip Destination when filename isn’t in the database (WIN)’ and click <Save>

    limagito file mover file memory option

    3. Enable the Rule and trigger it once, the Rule will run and fill the file memory database. With the ‘Skip Destination when filename isn’t in the database (WIN)’ enabled the Rule will skip the destination during this scan and only fill the file memory database.

    limagito file mover manual trigger

    4. Next, Disable ‘Skip Destination when filename isn’t in the database (WIN)’ and click <Save>

    limagito file mover file memory option

    This way the file memory database was filled with the existing [WIN] Source files. Any new files in the source will be copied once during the next scan.

     

    If you need any help with this “skip files if they already exist” question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team How-to
  • 20 Oct

    Problem copying a file due to a folder tree that is too long

    Problem copying a file due to a folder tree that is too long

    Q: I’m contacting you because we’re experiencing a problem when retrieving and copying a file stored on AWS (bucket) via LimagitoX v2023.5.12.0 (screenshot attached). The problem seems to be linked to the length of the folder tree containing the file. In fact, when we test with a shorter tree path, the file is copied successfully. Unfortunately, according to AWS, it is not possible to modify the path length of the tree structure.

    To give you more information on the problem, I’ve attached two log files:

    • Log_OK_SrvLimagitoX.Ruleld : short tree path with which the copy works.
    • Log_KO_SrvLimagitoX.Ruleld: tree path imposed by AWS that generates the error (which doesn’t work).

    A: We found some renaming errors in the log file.

    2024-04-26 15:26:18 AMS_BI_AMAZON_TEST_S3_VGO [AWSS3GET] Rename Exception Error: Rename C:\Users\Admin_Limagito\AppData\Local\Temp\LimagitoX\LimagitoX.740\aps-download-publisher-11111111-5ce6-49d8-8037-111111111\versionId=c36c10e4-d59c-4f20-82f4-111111111111\executionDate=20240426\part-00000-111111111111111111111111111111111111.c000.csv.tmpdwnld To C:\Users\Admin_Limagito\AppData\Local\Temp\LimagitoX\LimagitoX.740\aps-download-publisher-11111111-5ce6-49d8-8037-111111111111\versionId=c36c10e4-d59c-4f20-82f4-111111111111\executionDate=20240426\part-00000-111111111111111111111111111111111111.c000.csv Error

    When downloading files from AWSS3, we first store the stream of data we are downloading locally on the system. The same counts for all non-Windows folders as source, like AZURE, SFTP, FTP, … . During the download, the file has a temporary extension (.tmpdwnld). After a successful download, the file will be renamed to its original extension. The problem here is that Windows doesn’t like very long path + filenames, please check: link.

    Solution: Please update to the latest build first (v2024.10.17.0 or higher)
    • Could you please open the Advanced option of this AWSS3 Rule:

    limagito filemover advanced rule options

    • Please add  \\%\  as prefix to your ‘Temporary Directory’ setup. Please, always keep the temporary folder on the local system where the file mover is installed!

    limagito file mover folder tree that is too long

    If you need any help with this “folder tree that is too long” question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Error , , ,
1 3 4 5 6 7 8 9 151
SEARCH