German Routes äöüß Converter
Hi,
i have written a small vb script to convert the created routes with strange signs to the german "specials".
ä = ä(ae), ö = ö(oe), ü = ü(ue), ß = ß(ss)
In the moment only for lowercase signs.
Put the code in an text file and name it "filename.vbs". Drag and drop the route on the script and an "_GER" version is created.
Please report any problems.
--script begin--
'ä = ä
'ö = ö
'ü = ü
'ß = ss or ß
Const ForReading = 1
Const ForWriting = 2
mydebug = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Filename = Wscript.arguments(0)
Filename2 = Filename+"_GER"
if mydebug = 1 then
Wscript.Echo(Filename)
Wscript.Echo(Filename2)
end if
Set objFile = objFSO.OpenTextFile(Filename, ForReading)
Set objFile2 = objFSO.OpenTextFile(Filename2, ForWriting, True)
Do Until objFile.AtEndOfStream
MyTextLine = objFile.ReadLine
MyTextLine = Replace(MyTextLine,"ä","ae") 'ä
MyTextLine = Replace(MyTextLine,"ö","oe") 'ö
MyTextLine = Replace(MyTextLine,"ü","ue") 'ü
MyTextLine = Replace(MyTextLine,"ß","ss") 'ß/ss
objFile2.WriteLine MyTextLine
Loop
objFile.Close
Wscript.Echo("FINISH")
--script end--
I know that can be coded better, but it's my first VB Script.
Cheers
GoDE
Edited: Code changes 18-Sept