James Posted April 7, 2008 Posted April 7, 2008 I made a script to do this, if you read the topic here you can find it. However there is the file UDF which has the _ReplaceInFile() function. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Xenobiologist Posted April 7, 2008 Posted April 7, 2008 (edited) Hi, Global $test = 'Ich weiß, daß ist nur ein ÜÖÄ ||| üöä Test ü, ö, ä, ÄÖÜ :-(!' ConsoleWrite(_changeString($test, 'Ü|Ö|Ä|ü|ö|ä|ß|(| ', 'Ue|Oe|Ae|ue|oe|ae|ss|)|_') & @CRLF) ConsoleWrite(_changeString($test, 'Ü|CH', 'Ue|CH!') & @CRLF) ConsoleWrite(_changeString($test, 'ch@|', 'ch@', 0, 1, '@') & @CRLF) ;=============================================================================== ; Function Name: _changeString ; Description:: Replace multiple Strings like StringReplace ; Parameter(s): Like StringReplace. $searchstring and $replacestring with | ; Requirement(s): --- ; Return Value(s): new string ; -1 = no | found ; -2 = string count do not match ; -3 = case should be 0,1,2 ; Author(s): Thorsten Meger (Xenobiologist) ;=============================================================================== Func _changeString($string, $searchstring, $replacestring, $count = 0, $case = 0, $delim = '|') If Not StringInStr($searchstring, $delim) Or Not StringInStr($replacestring, $delim) Then Return -1 Local $searchstring_A = StringSplit($searchstring, $delim), $replacestring_A = StringSplit($replacestring, $delim) If UBound($searchstring_A) <> UBound($replacestring_A) Then Return -2 If $case < 0 Or $case > 2 Then Return -3 For $i = 1 To UBound($searchstring_A) - 1 $string = StringReplace($string, String($searchstring_A[$i]), String($replacestring_A[$i]), $count, $case) Next Return $string EndFunc ;==>_changeString Mega Edited April 7, 2008 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
weaponx Posted April 7, 2008 Posted April 7, 2008 I see what you mean, you almost have to read in the entire file and replace one character at a time.
weaponx Posted April 7, 2008 Posted April 7, 2008 (edited) That's exactly what I'm trying to do... but i can't figure out how to do it...will replacing one alphabet at a time take a long time?Umm it depends on how large your file is. Why don't you just get a new keyboard? They are like $6 on Newegg. Edited April 7, 2008 by weaponx
James Posted April 7, 2008 Posted April 7, 2008 What you could do is assign each letter with the 'broken' letter, then replace it though the file. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted April 7, 2008 Posted April 7, 2008 Compare correct alphabet to broken alphabet. Replace each letter of the original word/letter to broken one. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Xenobiologist Posted April 8, 2008 Posted April 8, 2008 Hi, yes replacing a letter replaced before can be a problem. Why not changing it to something like @@1@@ and @@2@@ and so on. And at the end you replace all the @@...@@ with what you need. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
everseeker Posted April 8, 2008 Posted April 8, 2008 Hi,yes replacing a letter replaced before can be a problem. Why not changing it to something like @@1@@ and @@2@@ and so on. And at the end you replace all the @@...@@ with what you need. MegaOr, simply use 2 files... input and outputOr, store data in an array, place modifications in second array, then output second array to data file... Everseeker
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now