I am trying to read a text file and do a string replace on each of the lines.
One of the lines in the file is very long (60000 characters)
#Include <File.au3>
#Include <Array.au3>
#include <Misc.au3>
lOCAL $aRetArray
_FileReadToArray("test.xml", $aRetArray)
For $i = 1 To $aRetArray[0]
If StringInStr($aRetArray[$i], 'System.Collections.Generic.List`1[System.Single]') Then
ConsoleWrite($aRetArray[$i] &@CRLF)
$aRetArray[$i] = StringReplace($aRetArray[$i], "System.Collections.Generic.List`1[System.String]", "")
ConsoleWrite($aRetArray[$i] &@CRLF)
EndIf
Next
_FileWriteFromArray("test.xml", $aRetArray, 1)
@errno after the string replace gives 0.
As written the file ends up unchanged.
StringInStr correctly identifies the line with the text in it but StringReplace doesn't do the replace.
Probaly missing something obvious?
Test.xml