I would like some help with vb script. I know next to nothing about vb scripting so bare with me. I wanted write a dos batch file to do this but quickly realized that this is too complicated for a batch file. After searching the internet I found a vbscript that removes the CR\LF but the only one I found that works, removes all of them. I only want to remove the last one.
This is code I found:
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("D:\VDW\VDW_Output\DDOD\TodayDDOD.csv", ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, chr(010), chr(013) "") ' chr(010) = line feed chr(013) = carriage return
Set objFile = objFSO.OpenTextFile("D:\VDW\VDW_Output\DDOD\TodayDDOD.csv", ForWriting)
objFile.WriteLine strNewText
objFile.Close
Thanks for the help
This is code I found:
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("D:\VDW\VDW_Output\DDOD\TodayDDOD.csv", ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, chr(010), chr(013) "") ' chr(010) = line feed chr(013) = carriage return
Set objFile = objFSO.OpenTextFile("D:\VDW\VDW_Output\DDOD\TodayDDOD.csv", ForWriting)
objFile.WriteLine strNewText
objFile.Close
Thanks for the help