dbTalk Databases Forums  

Introduction and Question re: Row Delimiter probs

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


Discuss Introduction and Question re: Row Delimiter probs in the microsoft.public.sqlserver.dts forum.



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

Default Introduction and Question re: Row Delimiter probs - 04-28-2005 , 10:14 AM






Hi, I'm Jennifer Kenney, I'm mostly SQL/TSQL, but I'm using DTS for obvious
DTS things, and I've got an issue with DTS respecting the Row Delimiters in
a text file (source) connection.

The fixed-width text file has a CRLF row delimiter, visible when I read it
in Word with the view options set to view all, and when I checked to see if
I could import it into Excel, it read the CRLF just fine BUT!!!

The individual rows are sometimes shorter than they ought to be; the last
field in the row isn't always present, and my data pump, instead of seeing
the Row Delimiter and moving the data down to the next row, is filling data
into the trailing field from the next record, then cutting off record 2
after the 30 chars that field allows and starting the next row with record
3.

Any advice?

JBK



Reply With Quote
  #2  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: Introduction and Question re: Row Delimiter probs - 04-28-2005 , 11:17 AM






Jennifer,

Then the file is not fixed-width in a strict sense. If you opened the file
and filled up missing width it would be working.

Ilya

"Jennifer Kenney" <jkenney (AT) pembrooke (DOT) com> wrote

Quote:
Hi, I'm Jennifer Kenney, I'm mostly SQL/TSQL, but I'm using DTS for
obvious
DTS things, and I've got an issue with DTS respecting the Row Delimiters
in
a text file (source) connection.

The fixed-width text file has a CRLF row delimiter, visible when I read it
in Word with the view options set to view all, and when I checked to see
if
I could import it into Excel, it read the CRLF just fine BUT!!!

The individual rows are sometimes shorter than they ought to be; the last
field in the row isn't always present, and my data pump, instead of seeing
the Row Delimiter and moving the data down to the next row, is filling
data
into the trailing field from the next record, then cutting off record 2
after the 30 chars that field allows and starting the next row with record
3.

Any advice?

JBK





Reply With Quote
  #3  
Old   
Jennifer Kenney
 
Posts: n/a

Default Re: Introduction and Question re: Row Delimiter probs - 04-28-2005 , 01:27 PM



Any ideas about how to fill that in automatically?

"Ilya Margolin" <ilya_no_spam_ (AT) unapen (DOT) com> wrote

Quote:
Jennifer,

Then the file is not fixed-width in a strict sense. If you opened the file
and filled up missing width it would be working.

Ilya

"Jennifer Kenney" <jkenney (AT) pembrooke (DOT) com> wrote in message
news:uqsvEUATFHA.2680 (AT) tk2msftngp13 (DOT) phx.gbl...
Hi, I'm Jennifer Kenney, I'm mostly SQL/TSQL, but I'm using DTS for
obvious
DTS things, and I've got an issue with DTS respecting the Row Delimiters
in
a text file (source) connection.

The fixed-width text file has a CRLF row delimiter, visible when I read
it
in Word with the view options set to view all, and when I checked to see
if
I could import it into Excel, it read the CRLF just fine BUT!!!

The individual rows are sometimes shorter than they ought to be; the last
field in the row isn't always present, and my data pump, instead of
seeing
the Row Delimiter and moving the data down to the next row, is filling
data
into the trailing field from the next record, then cutting off record 2
after the 30 chars that field allows and starting the next row with
record
3.

Any advice?

JBK







Reply With Quote
  #4  
Old   
shumaker@cs.fsu.edu
 
Posts: n/a

Default Re: Introduction and Question re: Row Delimiter probs - 04-28-2005 , 02:35 PM



I handle things like this with ActiveX scripts. My preference for text
manipulations is PERL. If you have ever programmed in C or even C++,
then PERL isn't to terribly difficult and is well suited for text
manipulation.

I think you'd want to read the file line by line, each time into a
local string variable, and check the length of the string, then output
that string with additional spaces to ensure it is the proper length.


Reply With Quote
  #5  
Old   
Jennifer Kenney
 
Posts: n/a

Default Re: Introduction and Question re: Row Delimiter probs - 04-28-2005 , 05:41 PM




<shumaker (AT) cs (DOT) fsu.edu> wrote

Quote:
I handle things like this with ActiveX scripts. My preference for text
manipulations is PERL. If you have ever programmed in C or even C++,
then PERL isn't to terribly difficult and is well suited for text
manipulation.

I think you'd want to read the file line by line, each time into a
local string variable, and check the length of the string, then output
that string with additional spaces to ensure it is the proper length.

Ugh. So do a connection before the data pump and adjust the text file
there?




Reply With Quote
  #6  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: Introduction and Question re: Row Delimiter probs - 04-29-2005 , 08:06 AM



Jennifer,

That is the idea. Plus to what shumaker (AT) cs (DOT) fsu.edu suggested you can do it
in an ActiveX task in the same DTS package prior to reading the file by data
pump. Look up FileSystemObject documentation.

Ilya

"Jennifer Kenney" <jkenney (AT) pembrooke (DOT) com> wrote

Quote:
shumaker (AT) cs (DOT) fsu.edu> wrote in message
news:1114716950.450143.264010 (AT) o13g2000cwo (DOT) googlegroups.com...
I handle things like this with ActiveX scripts. My preference for text
manipulations is PERL. If you have ever programmed in C or even C++,
then PERL isn't to terribly difficult and is well suited for text
manipulation.

I think you'd want to read the file line by line, each time into a
local string variable, and check the length of the string, then output
that string with additional spaces to ensure it is the proper length.

Ugh. So do a connection before the data pump and adjust the text file
there?





Reply With Quote
  #7  
Old   
Jennifer Kenney
 
Posts: n/a

Default Re: Introduction and Question re: Row Delimiter probs - 04-29-2005 , 09:47 AM



Thanks, everybody who wrote in on this. This morning I put the text file
through an intermediary data pump to a holding text file, setting the
properties on the original file to character delimiter (using a character
that does not appear in the file), and setting the transformation to

DTSDestination("Col001") = DTSSource("Col001") + Space(
1321-Len(DTSSource("Col001")) )

where '1321' is the desired record length. Setting the field delimiter to a
non-existent character forced it into recognizing the row delimiter, the
data pump does its thing almost instantaneously, and DTS reads the resulting
file flawlessly.

Many thanks!

JBK

"Jennifer Kenney" <jkenney (AT) pembrooke (DOT) com> wrote

Quote:
Hi, I'm Jennifer Kenney, I'm mostly SQL/TSQL, but I'm using DTS for
obvious DTS things, and I've got an issue with DTS respecting the Row
Delimiters in a text file (source) connection.

The fixed-width text file has a CRLF row delimiter, visible when I read it
in Word with the view options set to view all, and when I checked to see
if I could import it into Excel, it read the CRLF just fine BUT!!!

The individual rows are sometimes shorter than they ought to be; the last
field in the row isn't always present, and my data pump, instead of seeing
the Row Delimiter and moving the data down to the next row, is filling
data into the trailing field from the next record, then cutting off record
2 after the 30 chars that field allows and starting the next row with
record 3.

Any advice?

JBK




Reply With Quote
  #8  
Old   
Shankar
 
Posts: n/a

Default RE: Introduction and Question re: Row Delimiter probs - 09-09-2009 , 02:34 AM



Hi Jennifer,

I too have the same issue. Can you please explain me in detail wt to be done.

Thanks, everybody who wrote in on this. This morning I put the text file
through an intermediary data pump to a holding text file, setting the
properties on the original file to character delimiter (using a character
that does not appear in the file), and setting the transformation to

DTSDestination("Col001") = DTSSource("Col001") + Space(
1321-Len(DTSSource("Col001")) )

where '1321' is the desired record length. Setting the field delimiter to a
non-existent character forced it into recognizing the row delimiter, the
data pump does its thing almost instantaneously, and DTS reads the resulting
file flawlessly.

Many thanks!

JBK


From http://www.developmentnow.com/g/103_...iter-probs.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/

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.