Create Csv File from DF adds additional commas

  • Hi,

    I'm trying to dynamically build a csv file, at start I delete the file. Then Create using a Data Flow task with a Ole DB Source writing to Flat File Destination.

    the source being: Select '' as 'Error Task'

    and it writes the file but when the Csv files is viewed in notepad it adds extra commas.

    Should have been: Error Task

    but outputs: Error Task , , ,

    or how can i create the file using the script task

    Please Assist,

    Regards

  • Not sure about the details of your problem, but if this is just a file containing a single row and no data, it is essentially static. Therefore, why not create it as a template file somewhere and then have a File Copy task which just copies it to your required destination?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Wow, Thank You that's great thinking.

    I simply did not think of it.

    Thank You 🙂

  • Hi, what column delimiter are you using when writing to the .CSV? (you can check this by opening the .csv in notepad or other text editor.

    It sounds like you're using commas - it's generally more compatible to use a semicolon as the column delimiter.

  • Thank You All,

    I tried using the semi colon, but whne viewing in notepad it returns an additional line with semicolons.

    Regards

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply