Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Variable row lengths
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

124 Posts

Posted - 09/07/2012 :  13:28:38  Show Profile  Reply with Quote
I have an Import/Export routine that grabs a .txt file and pulls it into a buffer table in my SQLServer 2005. The .txt file is fairly straight forward except for one anomaly.

This is an order file given to me from a large e-commerce company, so to begin...there is nothing I can do to change the way I'm getting the data. A specific type of record that they send through on the file has the row delimiter (CR/LF) at the end of column #65 but the rest of the file goes to 73 columns. So it looks like this:



Because there are not column delimiters<tab> to fill out the rest of the rows, the data in the row immediately following the anomaly row gets messed up.

Can anyone think of a way to get the data to flow in smoothly, so the Import/Export setup knows to always start a new row at the CR/LF. In the Source data setup, {CR}{LF} is CLEARLY chosen as the Row delimiter.

Any help is much appreciated.

Thanks in advance.

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 09/09/2012 :  12:57:51  Show Profile  Reply with Quote
i think best thing would be to use ssis package and parse data file using script task and insert the missing tabs in cases column dont exists (anamoly rows). then giving it to normal data flow task should run export smoothly

SQL Server MVP

Go to Top of Page

Posting Yak Master

124 Posts

Posted - 09/10/2012 :  16:24:10  Show Profile  Reply with Quote
Thanks visakh16. I think I'm officially out of my league on your suggestion as I have no experience writing a custom script to parse the data. I do know a pretty good programmer/developer locally and I'll see if he can help me get in the right direction.

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000