how to eliminate double quotes for column headers in flatfiledestination

  • hello All,

    in my project i have one data flow it contains OLEDB source (read data from sql server table) and FLATFILE destination (write to csv file)

    i.e when i write data to csv file it needs to be each value surround with double quote value(only records not the column headers).

    so i selected the option Text Qualifier as " so it is also working fine,

    but the problem is double quotes is applying to column headers to ....

    presently it is writing data as below

    "transno","amount","items"

    "123","300","5"

    "213","250","1"

    "333","100","3"

    but actually it needs to be as below (only record values surround with double quotes not column headers)

    transno,amount,items

    "123","300","5"

    "213","250","1"

    "333","100","3"

    how can i eliminate the double quotes only for column headers and it remain with values

    please give me any ideas.

    refered article http://www.mssqltips.com/tip.asp?tip=1316

    thanks in advance

    asin

  • Can any one provide any ideas,

    how to eliminate the double quotes in first line

    can i write a program which opens the file and removes the double quotes for first line only then save & closes the file

    can any one please give me any ideas to remove double quotes in the column headers

    Regards

    asin

  • I don't think it should double quote the header part. I am not sure what exactly you doing. Are you adding Header information to flat file or you just adding the columns name in the flat file. There is a option when you make flat file connection about selecting (check mark) the columns name in the first row. when you do this, ur column name shouldn't be text qualified...............

  • Hello Jayendra,

    I don't think it should double quote the header part.

    yes it is exactly double quotes (because when i clear the Columns name i nthe first row, then no double quotes at all in my csv(destination) file)

    I am not sure what exactly you doing.

    actually i have some data in one table (Source) , need to get the data and load into csv file(by using flat file destination),

    when i drag & drop Flat file destination specifying the file path, selecting Columns name in the first row, then specify text qualify as " (because as per requirement it needs to be each value should be surround with double quotes(not the column headers).

    Are you adding Header information to flat file or you just adding the columns name in the flat file.

    just adding column names in flat file by selecting the option Columns name in the first row

    when you do this, ur column name shouldn't be text qualified...............

    but here it is qualifying jayendra

    thank you for your interest,

    please help me if you have any ideas

    Regards

    asini

  • Hello All,

    now as per user requirement they said that they dont want the column headings at all

    so no issue.

    however i have some idea in my brain (i.e just create a file without headers then append the data to another file which will have only column headers) i dont know whether it could be done or not!

    even i stopped thinking on above solution

    Thank you jayendra for your response

    Best Regards

    asin

  • I guess I don't understand... what's wrong with having the double quotes in the column headers? That's how a true CSV file should be formed.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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