473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Find and Replace special characters in a field

I have the system setup to import a DomainList.csv file into a table
called tblDmnLst. It contains a column called "NitchMarket" (datatype
= text 75 character) where the user has discribed the market for that
domain. I need to loop through those records and find any feild that
contains a "_" underscore or a "-" dash and replace those characters
with a "/" slash.

can anyone help me out with the VBA code to do this.
thanks in advance
Bobbie

Nov 13 '05 #1
6 21145
Bobbie:

One alternative would be to use an update query. For example:

UPDATE tblDmnLst
SET tblDmnLst.NitchMarket = Replace(Replace([NitchMarket],"_","/"),"-","/");

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
<bo***********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I have the system setup to import a DomainList.csv file into a table
called tblDmnLst. It contains a column called "NitchMarket" (datatype
= text 75 character) where the user has discribed the market for that
domain. I need to loop through those records and find any feild that
contains a "_" underscore or a "-" dash and replace those characters
with a "/" slash.

can anyone help me out with the VBA code to do this.
thanks in advance
Bobbie
Nov 13 '05 #2
Very cool David thanks.
How do I check for the "+" sign at the end of a string and remove it
(not replace). I don't want to leave any plus signs hanging out at the
end of the string.

Thanks again, Bobbie

Nov 13 '05 #3

bo***********@gmail.com wrote:
Very cool David thanks.
How do I check for the "+" sign at the end of a string and remove it
(not replace). I don't want to leave any plus signs hanging out at the
end of the string.

Thanks again, Bobbie


Right$(MyString,1)="+"

Nov 13 '05 #4
Right$(MyString,1)="+"
finds the + sign at the end but how do I remove it?
Can I incorporate that somehow into this SQL statement

UPDATE tblDmnLst
SET tblDmnLst.NitchMarket =
Replace(Replace([NitchMarket],"_","/"),"-","/");

Thanks

Nov 13 '05 #5
Bobbie:

Removing the "+" at the end of the string would just require an additional
step. For example:

UPDATE tblDmnLst
SET tblDmnLst.NitchMarket =
Replace(Replace(IIf(Right([NitchMarket],1)="+",Left([NitchMarket],Len([NitchMarket])-1),[NitchMarket]),"_","/"),"-","/");

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
<bo***********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Very cool David thanks.
How do I check for the "+" sign at the end of a string and remove it
(not replace). I don't want to leave any plus signs hanging out at the
end of the string.

Thanks again, Bobbie
Nov 13 '05 #6
You could also use a tool like DataPipe (www.datamystic.com) to
search/replace the fields in the database using a regex.

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Pikkel | last post by:
i'm looking for a way to replace special characters with characters without accents, cedilles, etc.
3
by: Barry Olly | last post by:
Hi, I'm working on a mini content management system and need help with dealing with special characters. The input are taken from html form which are then stored into a varchar column in...
5
by: djc | last post by:
I need to prepare a large text database field to display in an asp.net repeater control. Currently I am replacing all chr(13)'s with a "<br/>" and it works fine. However, now I also want to be able...
6
by: Peter.Laganis | last post by:
Hi to all, I apologize in advance if a similar question was already posted, but I didn't find it. Here is my problem: I would like to replace all the special characters ' ¾' with another...
1
by: sonald | last post by:
Dear All, I am working on a module that validates the provided CSV data in a text format, which must be in a predefined format. We check for the : 1. Number of fields provided in the text file,...
7
by: Trac Bannon | last post by:
When I load XML from a file into a dotNet XMLDataDocument, the UTF-8 codes are resolved but the 5 special XML entities are not. How can I force those 5 special character types to be translated?
0
by: dearsaran | last post by:
Hi, I Want a function written for finding the special characters in a emailid.. Suppose, i've a column email in a table and inserting a emailid with any of the special characters then if i...
5
by: Sobin Thomas | last post by:
Hi All, I want to pass a string that contains many special characters (: \ . _ etc) to another page in my website through query string. In my project I have a Gridview control ,in which there...
6
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello, I have some XML that is returned to my application from another vendor that I cannot change before it gets to me. I can only alter it after it gets to my application. That being said, I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.