dbTalk Databases Forums  

text file with multiple lines per record

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss text file with multiple lines per record in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Hoyer
 
Posts: n/a

Default text file with multiple lines per record - 06-08-2004 , 11:37 AM






I need some suggestions on how to go about using DTS to bring a text
file into sql. The catch is that the text file has multiple lines per
record, as defined in the first line of the record. I need to
concatenate the subsequent lines into one field of database.

Example:

record# #lines recordtype

4714007 3 L
line 1
line 2
line 3

4714008 4 L
line 1
line 2
line 3
line 4

Thanks in advance,

Steve Hoyer


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: text file with multiple lines per record - 06-08-2004 , 02:27 PM






Maybe you can play with the DTSTransformStat values

I do it here though I take 1 input and give multiple outputs

Processing The Same Row More Than Once
(http://www.sqldts.com/default.aspx?266)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Steve Hoyer" <stevehoyer (AT) hotmail (DOT) com> wrote

Quote:
I need some suggestions on how to go about using DTS to bring a text
file into sql. The catch is that the text file has multiple lines per
record, as defined in the first line of the record. I need to
concatenate the subsequent lines into one field of database.

Example:

record# #lines recordtype

4714007 3 L
line 1
line 2
line 3

4714008 4 L
line 1
line 2
line 3
line 4

Thanks in advance,

Steve Hoyer


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
  #3  
Old   
Steve Hoyer
 
Posts: n/a

Default Re: text file with multiple lines per record - 06-10-2004 , 02:42 PM



I ended up writing a little vb.net app to deal with it, and just call it
in the DTS package

Thanks

Steve Hoyer


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.