dbTalk Databases Forums  

Comments on text file

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


Discuss Comments on text file in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Eduardo Greco
 
Posts: n/a

Default Comments on text file - 07-26-2004 , 05:32 PM






Hi there...
Imagine that I need a comment in the beggining and the end of each
table records. And my records come in blocks from different tables.
How to insert it?
Thanks!

Example:

*TABLE1* (Line with the comment)
1,2,3
2,3,4
*EOF*

*TABLE2*
1,2,3,4
2,3,4,5
*EOF*

Thanks again...



Reply With Quote
  #2  
Old   
Sergei Ivanov [MSFT]
 
Posts: n/a

Default Re: Comments on text file - 07-27-2004 , 01:12 PM






This is a non-uniform file format and for these it is best to write a custom
parser in VB.NET using Script Component in the Data Flow Task.

If the number of tables is fixed in a file, then you just create multiple
outputs in the Script Component and add rows to appropriate outputs as you
parse them.

If on the other hand the names and number of tables in the file are not
known in advance, it gets more complicated. Basically you need to write a
program that parses the file, breaks it up in smaller chunks and creates an
in-memory DTS package through our object model to load each of those files.

-Sergei

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Eduardo Greco" <eduardo (AT) persocom (DOT) com.br> wrote

Quote:
Hi there...
Imagine that I need a comment in the beggining and the end of each
table records. And my records come in blocks from different tables.
How to insert it?
Thanks!

Example:

*TABLE1* (Line with the comment)
1,2,3
2,3,4
*EOF*

*TABLE2*
1,2,3,4
2,3,4,5
*EOF*

Thanks again...





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.