dbTalk Databases Forums  

Importing Variable Length Flat File

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


Discuss Importing Variable Length Flat File in the microsoft.public.sqlserver.dts forum.



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

Default Importing Variable Length Flat File - 07-12-2006 , 01:23 PM






I have a large text file (3.5GB) that I need to import. Each record is
terminated with a CR/LF. However, the length of each record varies (60
characters to 79 characters). The last field in each record is a name field
that is not padded with blanks at the end.

My different attempts to copy this with DTS (to another flat file, db, etc)
have not worked.

Does anyone have a solution that they would please share with me?

Thanks.

Mike.

Reply With Quote
  #2  
Old   
Davide
 
Posts: n/a

Default Re: Importing Variable Length Flat File - 07-12-2006 , 02:30 PM







MikeV06 wrote:
Quote:
I have a large text file (3.5GB) that I need to import. Each record is
terminated with a CR/LF. However, the length of each record varies (60
characters to 79 characters). The last field in each record is a name field
that is not padded with blanks at the end.

My different attempts to copy this with DTS (to another flat file, db, etc)
have not worked.

Does anyone have a solution that they would please share with me?

Thanks.

Mike.
In your Filesource Connection choose 'Delimited' (not'Fixed Fields')
checkbox,choose {CR}{LF} like Row delimiter,click Next and select a
column separator if exists.

Try it

Bye



Reply With Quote
  #3  
Old   
MikeV06
 
Posts: n/a

Default Re: Importing Variable Length Flat File - 07-12-2006 , 05:18 PM



On 12 Jul 2006 12:30:53 -0700, Davide wrote:

Quote:
MikeV06 wrote:
I have a large text file (3.5GB) that I need to import. Each record is
terminated with a CR/LF. However, the length of each record varies (60
characters to 79 characters). The last field in each record is a name field
that is not padded with blanks at the end.

My different attempts to copy this with DTS (to another flat file, db, etc)
have not worked.

Does anyone have a solution that they would please share with me?

Thanks.

Mike.

In your Filesource Connection choose 'Delimited' (not'Fixed Fields')
checkbox,choose {CR}{LF} like Row delimiter,click Next and select a
column separator if exists.
I had done that, but I had not used {CR}{LF} as a column delimited so that
I was importing a single column. Without doing that, the system gets
confused. I then used VBScript transformations to copy the single column
(with mid) to the appropriate fields.

Thanks.


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.