File with Varying and Repeated Header and detail rows
hello , I am facing a challenge in parsing a raw file to load into database. This comes as a raw file and if we open this with raw source , ssis doesn't read this so i copy this and convert into a text file (txt) and then load it into a database table. Header1;header2;header3;header4;header5;header6 Detail1;Detail2;Detail3;Detail4;Detail5;Detail5;Detail6 Header1;header3;header4;header6;header9;header10;header11;header16;header21 Detail1;Detail3;Detail4;Detail6;Detail9;Detail10;Detail11;Detail16Detail21 Header1;header24;header45;header46;header47;header50 Detail1;Detail24;Detail45;Detail46;Detail47;Detail50 ......................... ........................ Note this is never a fixed it can change the rows sequence at anytime means First two row may come on 3rd and 4th rows also so solution must be flexible enough . It has around 20 k rows so if you see we have to pickup each row just like top 2 fashion (Group them ) But the problem comes that we are Not interested in all the columns we want lets say only interested in Header1, Header3, Header5, Header6 , Header50 to bring inside our main table I am having problem to picking up particular few columns and their details I want to do this inside SSIS 2008 , any one has done it like this before, please let me know all the possible things i can do I have gone through a lot of articles But couldn't get ssis out of box functionality for this kind of file If any one enthusiastic i can send them real file via mail since its very sensitive data there Thanks in advance if you can help me dsu
May 30th, 2011 2:28pm

If there is some logic/predictability in how the file is structured (what are the possibilities in juggling the rows?) I would just pre-process it using a Script Task in which using VB or C# libraries would help create a cleaner file with only those fields of interest to you. Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2011 2:41pm

Unfortunately there is no predictability. (however i have done this into java but now would like to do everything in the SSIS if possible) Sorry accidentally i presses the answer option But i guess the trick is just pick up only top 2 all the time and then keep top 2 deleting it so always your top 2 will be criterion But problem comes when you have varying columns in SSIS it will break means dynamically map will fail. Any other idea please dsu
May 30th, 2011 4:53pm

Unfortunately there is no predictability. (however i have done this into java but now would like to do everything in the SSIS if possible) Sorry accidentally i presses the answer option But i guess the trick is just pick up only top 2 all the time and then keep top 2 deleting it so always your top 2 will be criterion But problem comes when you have varying columns in SSIS it will break means dynamically map will fail. Any other idea please dsu
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2011 4:53pm

Maybe you can create your own source with the Script Component (type source). Something like: http://microsoft-ssis.blogspot.com/2011/02/script-component-as-source.html If you know how to do it in Java, it shouldn't be a big problem to come up with a C# variant.Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
May 31st, 2011 2:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics