Solved

SSIS - flat file with rows differing in number of fields

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP installation issues 11 59
SqlDataBase 7 46
2016 SQL Licensing 7 40
SQL Server 2012 r2 - Varible Table 3 19
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
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.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

813 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

10 Experts available now in Live!

Get 1:1 Help Now