Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

BATCH - replace vowels

Name: Anonymous 2009-05-17 6:07

help me, /prog/, you are my only hope!
i need to write a .bat that goes through a text and replaces all vowels by another character. don't ask for sense in that.
here is my code:

SET ersatz=a
:SchleifeVok
SET Zeichen=%Inhalt:~0,1%
SET Inhalt=%Inhalt:~1%
 ---> goes through the text, takes first character
FOR %%i in (a e i o u ä ö ü) DO IF ("%Zeichen%"=="%%i")  (ECHO %Ersatz%>>chinesen2.txt) ELSE (ECHO %Zeichen%>>chinesen2.txt)
 --> if the current character is either a e i o u ä ö ü, it will replace that with %Ersatz%
IF "%inhalt%"=="" (PAUSE) ELSE (GOTO SchleifeVok)

anyways, this does not work - neither does it replace ANY character nor does it ECHO the text correctly, but the biggest problem is how the replacement is not working.
tell me, /prog/, how do i fix this??

Name: Anonymous 2009-05-17 10:32

YOU.
ALL.
SUCK.
found this solution:

SET inhalt=%inhalt:e=a%
SET inhalt=%inhalt:i=a%
SET inhalt=%inhalt:o=a%
SET inhalt=%inhalt:u=a%
SET inhalt=%inhalt:ä=a%
SET inhalt=%inhalt:ö=a%
SET inhalt=%inhalt:ü=a%
SET inhalt=%inhalt:ß=ss%
ECHO %inhalt%>>chinesen2.txt

works perfectly

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List