Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete nul into a string

Status
Not open for further replies.

gvrgvr

Programmer
Oct 26, 2005
17
FR
i have a file with several records.
each record contains many nul (ASCII:0) and is terminated by lf.

i want to read this file, delete all nul and write a nex file.

i can't do it with the "replace" function.

anyone can help me? thanks
 
[1] If the nul char is an artifact coming from unicode format, you should simply open the text file using fso opentextfile method with specific parameter setting on unicode format. Read the file to a string and save the string to a text file of ascii format.

[2] If it is a generic data, then you can read the file and use regexp to do the replace.
[tt]
's the string from reading the whole file
set rx=new regexp
with rx
.global=true
.pattern="\00"
end with
s=rx.replace(s,"")
'save s to a text file
[/tt]
 
i can't do it with the "replace" function
Why ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top