• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 469
  • Last Modified:

Replace an special character

Im trying to import a csv file into a system but I'm getting errors because some ENTER character are been transfer from SQL 2000 query in to the CSV.

There is any way that I can replace specials characters?

Thank you
0
amedexitt
Asked:
amedexitt
  • 3
  • 2
  • 2
  • +1
1 Solution
 
QPRCommented:
You need to find out what they are...
How are you importing? DTS pacakge?
Is it a carraige return?
If so then when you do the transformation try....

DTSDestination("myTableColumn") = replace(DTSSource("MyCSVFile"),char(10),'')

or is it char(13) I forget... you may need to both in which case nest the 2 replace functions
0
 
YurichCommented:
char( 13 ) - carrage return, char( 10 ) - line feed. Most likely it's char( 13 ) as they not necessarely go together, but you can do for both to be safe.

regs,
yurich
0
 
amedexittAuthor Commented:
They are return. I'm Exporting the file with the Enterprise manager
The name of the table is Pol and the field is Address
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
amedexittAuthor Commented:
OK I did the Char (13)  and I take the first part before the Return but how can I get the second Line For Examp

235 nw  (Return)
75 st

Now and geting only the 235 nw and I need to get every thing (235 nw 75 st)without the return

Thank you
0
 
QPRCommented:
Consider using DTS, you will have infinately more control over the file and it's contents
0
 
QPRCommented:
Is 235 nw  (Return)
75 st
in the same cell?

I'm not sure why you aren't getting everyting
0
 
YurichCommented:
replace it with ' ' (blank space) not with '' (empty) - might be some difference

I can suggest that you still have it but it's not show right away as probably a line feed still sitting there. If you go to Enterprise Manager and view the contents of your table, you can try to cick inside and then arrow down - it might show you the second line.

In which case, you need to replace line feed as well.

good luck,
yurich
0
 
imran_fastCommented:
>>The name of the table is Pol and the field is Address

use dts with and select specify query to import data from

in the query window write
select column1, column2, replace(Address, char(13),'') as Address from Pol

then import it in Excel.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now