|
-
Jun 8th, 2012, 02:48 PM
#1
Thread Starter
New Member
Remove special characters from csv file
I have a csv file and it has some special characters that blocking to insert data into a SQL server.
How I can remove the characters before it dumps data into SQL.
Any idea will be appreciated.
Thanks
-
Jun 8th, 2012, 03:09 PM
#2
Frenzied Member
Re: Remove special characters from csv file
You could have an array with all the special character in it like so:
vb Code:
Dim arr(7) as String = {"!","@","#","$","%","^","&","*"} 'Then loop through the special character array and replace the ones in the csv text with "". For each sc as string in arr myCSVText = myCSVText.Replace(sc,"") Next
Justin
-
Jun 8th, 2012, 03:10 PM
#3
Re: Remove special characters from csv file
Use parameter objects to add values to your sql command, rather than concatonating data.
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
-
Jun 8th, 2012, 04:18 PM
#4
Thread Starter
New Member
Re: Remove special characters from csv file
Can you please elaborate little bit more. Thanks in advance!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|