Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSV Import problem

Status
Not open for further replies.

SQLSister

Programmer
Jun 18, 2002
7,292
US
I have a .csv file which has {CR}{LF} as the row delimter, Vertical bar as the column delimter and " as the Text qualifier. I can look at the file in Notepad and see that the records are clearly set up this way. But when I try to import the file it is only seeing the first column. Anybody else ever run into this and what could be causing it?
 
Try running it through Access if you have a copy. You may be running into a "Non Whitespace Character" issue at the end of your records. Access is pretty good at parsing those records out where as SQL Server\DTS just chokes on them.

Thanks

J. Kusch
 
Actually what we ended up doing was writing a parser in .net because the individual text fields had carriage returns in them. It counts the nuymber fo fields the record is supposed to have and if it fewer, it pulls the next line into that record. Now my current problem is to figure out how to get rid of the HTML code that some of their users put into the text, particularly that code which is the link to an image we don't have. I've tried using replace and wildcards in the update statement, and while it says the right number of rows were affected, the text never changes! GrrrrArrrg!


Update wisc
set gen_desc = replace(gen_desc, '%<img%>', ' ')
is what I tried. Any ideas?
 
I am sure it was a typo above ... but your replace statment should have read ...


set gen_desc = replace(gen_desc, '%<img>%', ' ')
and not
set gen_desc = replace(gen_desc, '%<img%>', ' ')



Thanks

J. Kusch
 
NO the % needs to be inside the <> because I have no way of knowing the rest of the HTML command (i.e. the specific path and filename they referenced) I don't want to replace the other text not included in the HTML code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top