Solved

SSIS - flat file with rows differing in number of fields

Posted on 2009-07-08
4
1,714 Views
Last Modified: 2013-11-10
Experts,

I am having issues with a basic Flat File connection trying to pull records that differ in length. The first row has around 200 fields but is not a header row. Subsequent rows have around
10 columns. I included an abbreviated example below and I believe the differing lengths are affecting the outcome as I get a msg reading "The last row in the sampled data is incomplete. The column or the row delimiter may be missing or the text is qualified incorrectly".. So when I review the recs in connection manager I notice the next row starting in the last row instead of starting a new row. It shows the {CR}{LF} but doesn't start a new row. The first 3 rows in the example refer to one acct - the acct num is the 2nd field..The first 2 chars designate the type of row(ie 01=encounter info, 02= charges). {CR}{LF} is the row delim and ^ is the col delim.

01^234566^y^Free text^45000^20020912^fff^940343^9300000+
02^234566^567^35000+
04^234566^free text^43450-
01^869433^y^Free text^45000^20020912^fff^940343^9300000+
02^869433^567^35000+
04^869433^free text^43450-

Please let me know if more detail is necessary. Any help would be very much welcomed.

Thanks, Jim


0
Comment
Question by:healthcheckinc
  • 2
4 Comments
 

Author Comment

by:healthcheckinc
ID: 24806496
I think I may have made this sound a little too difficult. What I need to do is to be able to extract certain data from a flatfile. If youll notice from above the first two chars are gonna contain different IDs. With each different ID comes a different set of columns, few of which match. Is there a way to read the flatfile and determine the ID and send them to seperate tables via ODBC destination? Thanks in advance
0
 
LVL 5

Accepted Solution

by:
jbyers79 earned 500 total points
ID: 24817467
You can use a conditional split component to split the different types of rows to various destinations based on the first two characters of the row.
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24867923
You can do that using a script component as a source.

Regards,
Pedro
www.pedrocgd.blogspot.com
www.BIResort.net
0
 

Author Closing Comment

by:healthcheckinc
ID: 31601193
thx
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now