CSV

  • 20 Apr

    How to export all rules to CSV with column name, source and destination

    Is there a way to export all Limagito rules to CSV or Excel with the column of name, source and destination?

    In a recent version of Limagito File Mover we added the following Pascal Script function to achieve this:

    Function psExportRuleDataAsCSV(Const aFile, aData, aDelimiter: String): String;

    aFile = Output Csv file, e.g. ‘C:\Temp\RuleList.csv’
    aData = a ; seperated list of items you want to add ( When empty string we’ll use ‘1;2;3;4’ )
    1 = RuleID
    2 = DisplayName
    3 = Source
    4 = Destination
    5 = Rule Status (version v2024.9.7.0 and up)

    • 0 = Unknown
    • 1 = Scanning Disabled
    • 2 = Rule in Hold
    • 11 = Delete Function: Enabled
    • 12 = Delete Function: Disabled
    • 13 = Delete Function: Thread(s) Terminating
    • 14 = Delete Function: Thread(s) Running
    • 15 = Delete Function: Error as Info Status
    • 21 = Move Function: Enabled
    • 22= Move Function: Disabled
    • 23 = Move Function: Thread(s) Terminating
    • 24 = Move Function: Thread(s) Running
    • 25 = Move Function: Error as Info Status
    • 31 = Copy Function: Enabled
    • 32 = Copy Function: Disabled
    • 33 = Copy Function: Thread(s) Terminating
    • 34 = Copy Function: Thread(s) Running
    • 35 = Copy Function: Error as Info Status

    7 = Information
    aDelimiter = csv delimiter used in the csv outputfile

     

    • Setup is easy, you’ll only need to add our ‘Pascal Script’ option as Source

    limagito file mover pascal script as source

    • Do not forget to adjust the ‘ctOutputCsv’ const:
      • Please add the following script: link

    limagito file mover export all rules to CSV

    • This is all you need to do, just enable and trigger the Rule now
    • Output Csv file content:

    RuleID,DisplayName,Source,Destination
    1,UNZIP Files Mike,[WIN]C:\Test\Out_Zip\,ID1[ZIP]C:\Test\Out_Zip\Out\
    2,WIN > Google Cloud Storage,[WIN]C:\Test\In\,ID2[GCLOUD]storage.googleapis.com/limagito/test
    3,GCloud > WIN,[GCLOUD]storage.googleapis.com/limagito/Test,ID1[WIN]C:\Test\Out\GCloud\

    If you need any help with our new ‘export all rules to CSV’ feature, please let us know. If you need more fields, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #FileManagement #filetransfer

  • 05 Jan

    How to remove the header row from a CSV file

    How to remove the header row from a CSV file

    Q: We have a CSV file that contains a header row.  Is it possible for Limagito to remove the first row in the file when we move it to a new folder?  Both the start and ending locations are on a windows server.

    A: Yes, this is possible. Please have a look at the following screenshots.

    • The customer is using a Windows folder as Source so we used this also in our example:

    limagito file mover Windows folder as source

    • We added an include filename filter so we are 100% we’ll only pickup .csv files:

    limagito managedfiletransfer filename filter

    • In our Destination setup we added our ‘Pascal Script’ option:

    limagito managedfiletransfer destination setup

    • Please add the following script (v1): link
    • We also added an alternative for the first script. In this script you can enable or disable the “TrailingLineBreak = finishing line break” (v2): link
      • psSaveListToFile(tmpList, tmpOutputFile, False);
      • psSaveListToFile(tmpList, tmpOutputFile, True);
    • We even added a third possibility where you can change the encoding and BOM of the resulting Csv file (v3): link
    • If you would need a different option, please let us know, many options are possible.

    remove the header row

    • RunTime Log Result:

    remove the header row

    #csv #managedfiletransfer #filetransfer #filemanagement

    If you need any help with this ‘remove the header row’ question, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team CSV Pascal Script , , ,
  • 30 Dec

    Split delimited files based on duplicate column

    Split delimited files based on duplicate column

    Q: We receive | (pipe) delimited files (no double quotes):

    Rvman International Inc. – US|CONTENT + US|1310001|0000000122|10/25/2023 1:54 PM
    Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM
    Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM

    Is it possible to create separate files of rows with the same content in column 4?

    The filename(s) would be incremental:

    original .csv

    Rvman International Inc. – US|CONTENT + US|1310001|0000000122|10/25/2023 1:54 PM

    original1.csv

    Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM
    Rvman International Inc. – US|CONTENT + US|1310002|0000000616|0/25/2023 2:10 PM

    Thanks for such a great product!

    A: Yes this is possible using our Pascal Script option

    We used a Windows folder as Source. In this folder we’ll search for .csv files.

    limagito file mover as source

    Since we are only interested in .csv files we added a filename include filter. We want to be sure we’ll only handle .csv files.

    limagito filemover filename filter

    As Destination we used our Pascal Script option. Please replace the default Destination Pascal Script.

    You can download the script: here

    The script will read the csv file with  a pipe as delimiter (this can be adjusted > ctPipe constant). We’ll check the content of column 4 which is index 3 (TStringList = zero index based).

    tmpCol4 := tmpPipe.Strings[3];

    Limagito File Mover pascal script as destination

    Output Result:

    Split delimited files based on duplicate column

    RunTime Log Result:

    limagito file mover runtime log result

    #csv #managedfiletransfer #filetransfer #filemanagement

    If you need any help with this ‘Split delimited files based on duplicate column’ question, please let us know.

    Best Regards,

    Limagito Team

1 2 3
SEARCH