French Characters and Hyphens

G

Guest

Hi Everyone!

I have the following types of names and want to convert to:
"CôtéJohnson " change to "CoteJohnson"
"Cote-Campbell " change to "Cote Campbell" or "Cote-Campbell" or
"CoteCampbell"
"Côté " change to "Cote"
"Cote,J" change to "Cote J" or "Cote,J" or "CoteJ"

So basically if there is a french character get rid of it and if you have
commas, hyphens, apostrophe, etc, replace it with a space. The comma etc.,
isn't a necessity as long as I could get rid of it, I don't really need a
space.

So far I've tried to change to UCase, then StrConv,3 , but those don't get
rid of the French characters. StrConv seemed to make the text in proper
characters and that's all. Also (what other #'s, i.e. not 3 can you use with
StrConv - and what do they do?) Do you know of a good online/book resource
for learning those functions? I know I need to trim, and that function is
working fine.

Thanks!!

~Jess
 
M

Michael Gramelspacher

Hi Everyone!

I have the following types of names and want to convert to:
"CôtéJohnson " change to "CoteJohnson"
"Cote-Campbell " change to "Cote Campbell" or "Cote-Campbell" or
"CoteCampbell"
"Côté " change to "Cote"
"Cote,J" change to "Cote J" or "Cote,J" or "CoteJ"

So basically if there is a french character get rid of it and if you have
commas, hyphens, apostrophe, etc, replace it with a space. The comma etc..,
isn't a necessity as long as I could get rid of it, I don't really need a
space.

So far I've tried to change to UCase, then StrConv,3 , but those don't get
rid of the French characters. StrConv seemed to make the text in proper
characters and that's all. Also (what other #'s, i.e. not 3 can you use with
StrConv - and what do they do?) Do you know of a good online/book resource
for learning those functions? I know I need to trim, and that function is
working fine.

Thanks!!

~Jess
You might use something similiar to this, which I use for German
umlauts, but if you want something really good then use the Unaccented
function by Ken Sheridan, 15 May 2006, in this same newsgroup.

Dim i As Integer
Dim CharReplace(1 To 4, 1 To 2) As String
Dim t As String

' there are 4 character pairs which need to be replaced

CharReplace(1, 1) = "ä"
CharReplace(1, 2) = "ae"
CharReplace(2, 1) = "ö"
CharReplace(2, 2) = "oe"
CharReplace(3, 1) = "ü"
CharReplace(3, 2) = "ue"
CharReplace(4, 1) = "ß"
CharReplace(4, 2) = "ss"

t = Nz(strInput, "")

For i = 1 To 4
t = Replace(t, CharReplace(i, 1), CharReplace(i, 2))
Next

ConvertFromUmlaut = t
 
G

Guest

Hi Michael,

Does this code say:
Find "ä" and replace with "ae"?

Will it work if I only want to:
Find "ä" and replace with "a"? (i.e. the replace is only 1 character)
 
M

Michael Gramelspacher

Hi Michael,

Does this code say:
Find "ä" and replace with "ae"?

Will it work if I only want to:
Find "ä" and replace with "a"? (i.e. the replace is only 1 character)


"Michael Gramelspacher" wrote:

Test this in a code window (Ctrl-G)by typing
?Replace("née","é","e") then return key in the Immediate window.

Mike Gramelspacher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top