Below, I have pasted code to a .vbs script I am using to try and change all of the little rectangles that appear in a text file when opened in windows after if the file was created on Linux or MACOSX. Basically, instead of breaking the line into separate physical lines, it creates a little rectangular icon. The ASCII value for carriage returns or new lines from MACOSX is 10 and the New Line ASCII value in windows is 13. If I could get the entire text document converted to ASCII, I could replace all of the 10's for 13's (or vice versa). This way, when I convert it back FROM ASCII TO TEXT, the script below would have made all carriage returns WINDOWS native and I could move on with my life. Please help if you have any thoughts if the ASCII feature of macroscheduler can do this type of character conversion throughout a file. Thanks in advance!
~Jesse
Code: Select all
Const ForReading = 1
Const ForWriting = 2
strFileName = Wscript.Arguments(0)
strOldText = "vbCr"
strNewText = "vbCrLf"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, strOldText, strNewText,1)
Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close