Solved

SSIS - flat file with rows differing in number of fields

Posted on 2009-07-08
4
1,743 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL, add where clause 5 23
Compare a numeric value to a varchar w/o getting an error 4 20
Help With SQL Query 9 29
SQL Recursion 6 16
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

839 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