Splitting single comma separated line

  • Hi All,

    My source file is coma separated file having 6 columns. But some times two lines are merging i.e. eow containas 12 columns instead of 6 and my package is failing.

    Kindly guide me how can i handle this issue?

    Thanks

    Abhas.

  • abhas (2/14/2014)


    Hi All,

    My source file is coma separated file having 6 columns. But some times two lines are merging i.e. eow containas 12 columns instead of 6 and my package is failing.

    Kindly guide me how can i handle this issue?

    Thanks

    Abhas.

    Should not be your problem.

    Speak to the people responsible for producing the source file and ask them to fix up the bug which is causing the issue.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • 1st of all i totally agreed with Phil.

    but most of the time ... they say ... there is no issue in it 😛

    here are couple of things you can try thou:

    1. Check that csv if its ending line 'CR' or 'LF'. (you can check it NotePad++)

    because, there might be a case try to adjust your row identifier, you can also check this file while to import its using MS Access as well. check if the same issue happens or not.

    if you are using flat file connection.

    2. you can parse the file in script manager, in that you can avoid it when you split the string and you can also log these error lines in a file or any tables as well.

  • twin.devil (2/14/2014)


    2. you can parse the file in script manager, ...

    What do you mean by this?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Phil Parkin (2/14/2014)


    twin.devil (2/14/2014)


    2. you can parse the file in script manager, ...

    What do you mean by this?

    Sorry, i meant to say is "Script Component" instead of "script manager".

  • twin.devil (2/14/2014)


    Phil Parkin (2/14/2014)


    twin.devil (2/14/2014)


    2. you can parse the file in script manager, ...

    What do you mean by this?

    Sorry, i meant to say is "Script Component" instead of "script manager".

    That was my guess, but I wanted to make sure that I hadn't missed something. 'Script Manager' sounds like a cool tool 🙂

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • As already stated fix the problem at source.

    Probable cause of 'joining' lines is missing CR char ie LF instead of CRLF

    If this is the case delimit on LF and remove CR from 6th column if present

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Correcting at the source is most logical thing.

    But, on the other hand you can validate your flat file before loading data into database. You load the good data into table. You can send the invalid data for correction or may be correct it using a utility. Here is something you can try (if you want)

    SSIS: How to validate Flat File Row Length?

    Vikash Kumar Singh || www.singhvikash.in

Viewing 8 posts - 1 through 7 (of 7 total)

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