dbTalk Databases Forums  

Textfile import misses first line!

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


Discuss Textfile import misses first line! in the microsoft.public.sqlserver.dts forum.



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

Default Textfile import misses first line! - 04-20-2004 , 04:26 AM






Hi

I am importing several textfiles to different SQL-tables, through a local tasks in DTS it works very well, but....

The ANSI-textfiles has one header row with a different layout so I skip it through Skip rows=1. When I look at the textfile in the Connection properties (Fixed Field Column Positions) everything is OK. The problem is that the Tranformation Data Task misses the second row (the first row that should be imported) both in the actual transfer as well as in the Preview

I have tried with different Row delimiters and different files but the problem remains.

I would be very pleased if someone has a suggestion on how to solve this problem/bug.

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

Default Re: Textfile import misses first line! - 04-20-2004 , 04:40 AM






You don't have "First Row Has Column Names" checked do you?

Does your first row have a valid EOL terminator for the file (i.e. the same
as the rest of the file)?

--

----------------------------

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


"Rick Deckard" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi!

I am importing several textfiles to different SQL-tables, through a local
tasks in DTS it works very well, but.....

The ANSI-textfiles has one header row with a different layout so I skip it
through Skip rows=1. When I look at the textfile in the Connection
properties (Fixed Field Column Positions) everything is OK. The problem is
that the Tranformation Data Task misses the second row (the first row that
should be imported) both in the actual transfer as well as in the Preview.
Quote:
I have tried with different Row delimiters and different files but the
problem remains.

I would be very pleased if someone has a suggestion on how to solve this
problem/bug.




Reply With Quote
  #3  
Old   
Rick Deckard
 
Posts: n/a

Default Re: Textfile import misses first line! - 04-20-2004 , 05:36 AM



Hi Allan

No I don't, the transformation is based on fixed columns in the sourcefile. This is really mysterious. All other software (Excel, Notepad etc) where I open the textfile the rows are correctly delimited

Thanks

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

Default Re: Textfile import misses first line! - 04-20-2004 , 05:50 AM



Quick search on google

http://groups.google.com/groups?q=%2...t.com &rnum=1

http://groups.google.com/groups?q=%2...tngxa08&rnum=3

--

----------------------------

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


"Rick Deckard" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi Allan,

No I don't, the transformation is based on fixed columns in the
sourcefile. This is really mysterious. All other software (Excel, Notepad
etc) where I open the textfile the rows are correctly delimited.
Quote:
Thanks



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

Default Re: Textfile import misses first line! - 04-20-2004 , 08:59 AM



Sounds good to me

--

----------------------------

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


"Rick Deckard" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Dear Allan & Google,

Thanks again. I checked the files with a Hex-editor, the header row is
delimited with the same type of row delimiter as the other rows (0x0d {CR}
and 0x0a {LF}). When I edit the textfile in notepad and delete the
headerline and then change the Text-source in DTS not to skip the first row
it all works (havent checked if it imports the last row yet!).
Quote:
Maybe the best workaround is to write some VB-script to delete the header
row from the sourcefile before DTS imports the file. I am a little bit lucky
because the first text on each "data-row" is a constant Tag. I'll have a
look at that first, or do you have any other suggestions.
Quote:




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.