Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Splitting single comma separated line


Splitting single comma separated line

Author
Message
abhas
abhas
SSC Veteran
SSC Veteran (298 reputation)SSC Veteran (298 reputation)SSC Veteran (298 reputation)SSC Veteran (298 reputation)SSC Veteran (298 reputation)SSC Veteran (298 reputation)SSC Veteran (298 reputation)SSC Veteran (298 reputation)

Group: General Forum Members
Points: 298 Visits: 662
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.
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: General Forum Members
Points: 8416 Visits: 19518
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.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
twin.devil
twin.devil
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1385 Visits: 2601
1st of all i totally agreed with Phil.

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

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.
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: General Forum Members
Points: 8416 Visits: 19518
twin.devil (2/14/2014)


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



What do you mean by this?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
twin.devil
twin.devil
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1385 Visits: 2601
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".
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: General Forum Members
Points: 8416 Visits: 19518
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 :-)


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
David Burrows
David Burrows
SSCertifiable
SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)SSCertifiable (8K reputation)

Group: General Forum Members
Points: 7977 Visits: 9445
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.


Vikash Kumar Singh
Vikash Kumar Singh
SSC Journeyman
SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)

Group: General Forum Members
Points: 81 Visits: 243
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search