Different Text file format
Hi all,
If the file format is one as follows, how should we go about in transferring the data? The first three rows would be something as given and the rest is normal way to transfer...
*****************************************************************
NAME:Xys
Action: 123
Action2: A2c
Date <Tab>
Age <tab> Address <Tab>
DOB
May 1 2011 22
asdfaf May 1
May 2 2011 23
sdfasgfasfg May 2
....
....
**********************************************
May 14th, 2012 10:12pm
Use a script task to parse it.
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2012 12:38am
Use script task to replace : in the source files to <tab> and then use that file as source.Otherwise using script task itself you can transfer data to target table.
Bharath T
May 15th, 2012 1:43am
Hi ,
you need to use the script component in the data flow task to import this type of file. please have a look into the following article which explain in details how to import transposed data in database:
http://www.rad.pasfu.com/index.php?/archives/38-Script-Component-as-Source-SSIS.html
thanks,
Zaim Raza.
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2012 2:06am
Use a Script Component in your Data Flow Task as a source. Something like Zaim Raza mentioned or here is an other
example. It will require .Net knowledge. The only alternative is to get a proper formatted text file.Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
May 15th, 2012 2:13am
Hi All,
Thanks for all your reply. Sorry, as there was some misunderstanding in the format posted by me... It's actually only the first 3 lines where I can use the script component.
<<<First 3 lines of the file>>> [for these 3 lines, I can use the script component]
NAME:Xys
Action: 123
Action2: A2c
<<<From 4th line onwards>>>
Date <Tab> Age <tab> Address <Tab> DOB --> Line 4
May 1 2011 <Tab> 22 <Tab>asdfaf <Tab> May 1 --> Line 5
May 2 2011 <Tab> 23 <Tab> sdfas <Tab> May 2 --> Line 6
Line 7.
.
.
.
.
Line 100
So from the 4th line onwards I can use a normal way to transfer the file to the table, If I use the script component first can I transact using a normal SSIS data flow task from the 4th line onwards...
In other words, If the first 3 lines are not there, it's a normal data flow task, how would I use the normal task after processing the first 3 lines...
Thanks
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2012 10:33pm


