Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Import textfile with no carriage return

Author  Topic 

ahmadjamalkhan
Starting Member

36 Posts

Posted - 2009-02-23 : 07:41:54
Hi
I get unix based cdr from in my ftp folder. These cdrs are csv file but since source was unix based platform. Lines only have line feed and no carriage return. As a a result while i try to import it into my sqlserver table using DTS , I get an error, Beause sql sees the entire lines as one single line.

I need help of how to go around this problem.

Thanks

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-23 : 07:49:09
You can select LF as the delimiter then. That is an option available there.
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-23 : 07:51:53
Another way is, You can convert the unix format file to a PC format file using editors like textpad etc. That'll replace your linefeed with linfeed and CR.
Go to Top of Page

ahmadjamalkhan
Starting Member

36 Posts

Posted - 2009-02-23 : 08:14:23
Hi, thanks for your reply. I prefer not to have a manuual interaction . As this DTS program is scheduled to run every 15 minutes.
It would be almost very difficult to open the document in textpad/wordpad and then import it to SQL.
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-23 : 08:17:45
quote:
Originally posted by ahmadjamalkhan

Hi, thanks for your reply. I prefer not to have a manuual interaction . As this DTS program is scheduled to run every 15 minutes.
It would be almost very difficult to open the document in textpad/wordpad and then import it to SQL.



Great, Use the first approach then.
Go to Top of Page

ahmadjamalkhan
Starting Member

36 Posts

Posted - 2009-02-23 : 08:36:29
I tried changing it to LF but i get an error saying "Could not find the selected row delimeter within the first 8kb of data"
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-23 : 08:53:09
I thought you mentioned that you have linefeed there in the file.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-23 : 09:08:11
Or, is data longer than 8000 bytes per record?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

ahmadjamalkhan
Starting Member

36 Posts

Posted - 2009-02-23 : 09:40:52
yes you are right , i do not think it has line feed.i was reading an article on unix and there it mentions that difference between windows and unix is that unix have line feed but no carriage return where windows has both and mac has no line feed but carriage return.
Basically when i open this text file in wordpad , all records are seprated in each row as it should be , also at the end of every line there is a SQUARE box charater.
If i open the same file in textpad , all the row appear has one big continous chain of records. You can not make out where each row starts and end.

Go to Top of Page
   

- Advertisement -