Forum Discussion

ChristopheFr's avatar
ChristopheFr
New Contributor II
2 years ago
Solved

Delete some characters from header before bulk load

Hello,
I would like to delete/replace some characters (typically .) from headers in xlsx or csv file before loading the file in SQL Server using bulk load.

Does someone has any idea ?

Thanks.

  • Mapper with :
    $.mapKeys((value,key) => key.replace("'",""))
    before bulk load solve the problem.

3 Replies

  • ChristopheFr - Welcome to the Community!

    You can read the file using a File Reader and CSV or Excel Parser, then use a Mapper or Structure snap to rename the columns, then use the SQL Server Bulk Load snap to push the data into the database.

  • ChristopheFr's avatar
    ChristopheFr
    New Contributor II

    Thank you for your reply.
    The main point is that I want something generic because I have n Excel files to load in n SQL tables.
    n varies all the days, And the structure of a file may vary from one day to another.
    That's why I was wandering if there is a possibility to have something like

    $.ExcelHeader.replace("'", "")

  • ChristopheFr's avatar
    ChristopheFr
    New Contributor II

    Mapper with :
    $.mapKeys((value,key) => key.replace("'",""))
    before bulk load solve the problem.