I must generate files for windows batch scripting, modifying template files, es.
dataIn = Import["template.bat","Lines"]; dataOut = aFunction[dataIn]; Export["aScript.bat",dataOut,"Lines"];
The problem comes from the box drawing characters (see https://en.wikipedia.org/wiki/Box-drawing_character ) in template.bat, because they are never diplayed rightly.
I have tried:
test[dataIn_, encoding_] := Export[ encoding <> ".bat", StringJoin @ FromCharacterCode[ ToCharacterCode[ Characters[dataIn] ], encoding ], "Text" ]; dataIn = Import["template.bat", "Text"]; test[dataIn, #] & /@ $CharacterEncodings;
but none of generated files works. How can I handle them ?