all groups > sql server dts > august 2006 >
You're in the

sql server dts

group:

SSIS Processing flat file with multiple record types


SSIS Processing flat file with multiple record types TimS
8/13/2006 10:11:26 AM
sql server dts: Hello, I am a novice with SSIS and have only used the DTS wizard to create
DTS packages. That being said, I was wondering if it is possible, and how
hard would it be to use SSIS to process a flat file that:

Is not delimited - is positional
Has multiple rows per object - a customer "record" consists of three
separate rows in the flat file. The first row starts with 1, the second row
starts with 2, etc.

There are multiple sets of rows with 1,2,3 that comprise several customer
"records"
Has a header and a trailer record.

Any advice would be appreciated!

RE: SSIS Processing flat file with multiple record types Charles Kangai
8/13/2006 11:31:01 AM
Wow! I imagine you would have to code a Script Component to do this. But SSIS
will definitely cope.

Charles Kangai, MCT, MCDBA

[quoted text, click to view]
RE: SSIS Processing flat file with multiple record types Charles Kangai
8/13/2006 12:54:01 PM
A second approach would be to use regular expressions to search for and
delete all carriage return linefeed characters that are not immediately
followed by a 1. You then save the resultant text as a new file. You can then
import this new file, because it will have one row per line. Your text file
is not field delimited, and that is no problem for SSIS.

Probably this approach would be easier than creating a Script component! In
fact it should be no more than a few lines of code, maybe less than 10!

Charles Kangai, MCT, MCDBA



[quoted text, click to view]
RE: SSIS Processing flat file with multiple record types TimS
8/14/2006 8:31:02 PM
Thank you for your response Charles. I will try out your suggestions.

Tim

[quoted text, click to view]
AddThis Social Bookmark Button