row

  • 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 , , ,
  • 15 Jan

    SQL output trailing delimiter at end of row

    Trailing delimiter at end of each row

    Q: We are using Limagito File Mover, SQL as source, database is MSSQL.

    SQL statement (Source)

    select

      person_last_name as last_name

      , person_first_name as first_name

    from
    my_table

    Common Options

    Limagito File Mover SQL Common options

    Issue

    The value for the delimiter is appended at the end of each row. Is there a way to prevent this from happening? The output file is being automatically imported into a system, and that system does not like that extra delimiter at the end of the file. To explain what I’m talking about, the output to the file is currently like this:

    last_name,first_name,

    Doe,John,

    Smith,Mary,

    What we would like to see is this:

    last_name,first_name

    Doe,John

    Smith,Mary

    Thank you for any assistance you can give.

    A: In version v2021.1.15.0 we added some extra options:

    • SQL Common options (default Enabled):
      • Trailing Line Break: Determines whether to add a line Break after the last line or not.
      • Trailing Line Delimiter: When enabled the value for the delimiter is appended at the end of each row

    Please disable ‘Trailing Line Delimiter’. This will remove the delimiter at the end of each row.

    Limagito File Mover SQL Common options

    If you need any info about this option, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team SQL , ,
SEARCH