Thanks for the suggestion, but I need to accomplish this with SSIS.
Main Topics
Browse All TopicsHi Experts,
I'm kinda stuck to implement the following logic, I have a source flat file and I need to parse the data from it to different tables for example
FHDNN 01NN .
CHD92003107082009 .
RHD92120930NN0000011800000
CUS92120930002 0000000 CJUF II PRTWORTH LLC3700 GEORGIA AVE NW 0 N .
MTR92120930001 00 0 0CA 70212207A 0000000020W0000001 00 00 000 NW 000
RTR92127720NN0000020400000
CTR92003107082009 .
FTRNN 01NN .
The package should be parsing this info to different tables depending upon the file header info
FileHeader Table
Col 1 Col 2 Col 3 .........
FHD N N .................so on
Anybody who can assess me with that?
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You cant' use a conditional split on this -- unless you find a way to parse the data into related chunks (based on header) -- which if you can do that -- you don't need a conditional split, since you can parse them into their own files.
As I said, this is NOT easy with SSIS. It comes down to old school text file parsing. SSIS doesn't natively make this easy. Which is why I suggested using Monarch.
The old school way of doing this was to read from the text file -- mark what the header is, process the data into either a separate text file or into a record set or whatever. When you hit the next header, process that data into another text file or a record set etc.. if you take the record set approach, you have to do something with it -- the issue that you might have with SSIS and doing this is that if you have dynamic count of columns coming out of the SSIS script task it can be troublesome.
Thus, I'm suggesting that you PARSE your files with a script task into MULTIPLE text files. Each Text file should represent a table. Then in your package you can have a data flow task that hooks dynamically to those text files through a connection string that is supplied by a variable -- set from when you created the files. Then you can have a data flow task for each table, or one for all of them -- or whatever you want to do.
What you're trying to do is an age old task. The problem is, the technology you're using isn't really designed to make old school way any easier. You'll need to hunker down and write a bunch of vb code in a script task to accomplish what you want.
I would use a script component in the data flow to set a variable with the current table name every time it encounters one, then append the table name to the beginning of each row of data (separated by some kind of delimeter). From there you could pipe the output through a conditional split component.
Business Accounts
Answer for Membership
by: HwkrangerPosted on 2009-08-06 at 10:13:52ID: 25035749
The easiest way is to use softare like "Monarch" where you can make templates.
Or you can parse the file into other files then process the new files.