Problem With Header

  • Hi All,

    I am passing a departname in the header. And my departname as comma in it. Example : Expense,Sales

    Since I am loading the data to the CSV. Expense and sales are getting separated where as i want them to be together by adding Qquatations to the string like " Expense,Sales". But I am not sure of how i can do this task. Please give me Ideas.

    Thanks,

    Preensheen

  • If you specify a data qualifier in your export, all of the fields will be enclosed in quotes (or whatever character you choose for it).

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (10/20/2010)


    If you specify a data qualifier in your export, all of the fields will be enclosed in quotes (or whatever character you choose for it).

    I did have specified the tect qualifier to my CSV export but ..it doesn't work for header.

    Please give me suggestions on the best way I can resolve my issues.

  • How are you building the header? If I remember correctly, you're using a local variable to do that. Can't you just add the quotes in the code where you build the header?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (10/20/2010)


    How are you building the header? If I remember correctly, you're using a local variable to do that. Can't you just add the quotes in the code where you build the header?

    My header is Dynamic, I will be storing the value coming from foreach to a variable and then pass that variable as the header. So I can't add the quotes when passing. If we can..please do tell me the steps.

    Thanks for the support

    Preensheed

  • Can you side-step the problem by replacing commas in your header variables with some other character before they are output? Or by using a different column delimiter everywhere else (eg ¦)?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • preensheen (10/20/2010)


    GSquared (10/20/2010)


    How are you building the header? If I remember correctly, you're using a local variable to do that. Can't you just add the quotes in the code where you build the header?

    My header is Dynamic, I will be storing the value coming from foreach to a variable and then pass that variable as the header. So I can't add the quotes when passing. If we can..please do tell me the steps.

    Thanks for the support

    Preensheed

    SSIS has functions in it for concatenating strings. How you do it depends on how exactly you're building the header.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (10/21/2010)


    preensheen (10/20/2010)


    GSquared (10/20/2010)


    How are you building the header? If I remember correctly, you're using a local variable to do that. Can't you just add the quotes in the code where you build the header?

    My header is Dynamic, I will be storing the value coming from foreach to a variable and then pass that variable as the header. So I can't add the quotes when passing. If we can..please do tell me the steps.

    Thanks for the support

    Preensheed

    SSIS has functions in it for concatenating strings. How you do it depends on how exactly you're building the header.

  • Why can't you just include the double quotes in with the header variable? How are you getting the header variable into the file?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • John Rowan (10/28/2010)


    Why can't you just include the double quotes in with the header variable? How are you getting the header variable into the file?

    Thanks a lot for all your support..I was able to resolve it by the way you mentioned it.

Viewing 10 posts - 1 through 9 (of 9 total)

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