Hi,
I am afraid that did not work. Any other suggestions?
Main Topics
Browse All TopicsHi,
I am looking for a VB script to parse a .txt file and remove any Null (ASCII 000) Characters.
I think it was sirbounty who provided me with a similar script below that can do this for carriage returns and line feeds so it should be pretty easy to adapt but I do not know the definition in VB for the ASCII 000 character ?
Many thanks
Rob
----
'Note = "vbCr is a carriage return, vbLf is a line feed, vbCrLf is both."
Dim objFSO: Set objFSO = CreateObject("Scripting.Fi
Dim objOutput: Set objOutput = objFSO.CreateTextFile("C:\
arrData = Split(objFSO.OpenTextFile(
For Each Item In arrData
strData = strData & Replace(Item, vbCrLf, "")
Next
objOutput.WriteLine strData
objOutput.Close
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Try this :
Dim objFSO,objOutput, objInput
Set objFSO = CreateObject("Scripting.Fi
Set objOutput = objFSO.CreateTextFile("Out
Set objInput = objfso.OpenTextFile("Input
Do While objInput.AtEndOfStream <> True
objOutput.WriteLine Replace(objInput.Readline,
Loop
objInput.Close()
objOutput.Close()
Business Accounts
Answer for Membership
by: lsavidgePosted on 2007-03-15 at 04:43:25ID: 18726067
Hi,
leSystemOb ject") testing2\O utput.txt" ) "C:\testin g2\sourcef ile.txt"). ReadAll, vbCrLf)
Try this then:
Dim objFSO: Set objFSO = CreateObject("Scripting.Fi
Dim objOutput: Set objOutput = objFSO.CreateTextFile("C:\
arrData = Split(objFSO.OpenTextFile(
For Each Item In arrData
strData = strData & Replace(Item, vbNull, "")
Next
objOutput.WriteLine strData
objOutput.Close
I changed this line:
strData = strData & Replace(Item, vbCrLf, "")
with
strData = strData & Replace(Item, vbNull, "")
I've not tested it but I think it should work.
Cheers,
Lee