|
-
March 29th, 2001, 06:07 AM
#1
Remove ascii 00 in files
hi,
I have some files containing the ascii value 00, (even if it isn't an ascii value). I want to write an VB app to replace this with character space.
Any suggestions,
Thans in advance
ThoRvalZ
-
March 29th, 2001, 07:12 AM
#2
Re: Remove ascii 00 in files
you got to open the file and read the whole content of the file into a string (try http://vblib.virtualave.net, there is a function in vbFileIO which able to do so).
Let say, you got the string already call s. then
do the following
for i = 1 to len(s)
if mid(s,i,1) = chr(0) then
mid(s,i,1) = chr(32)
end if
next i
after this, the string should no longer contain any 0 but space instead.
so, you need to write the string back to a file, again , there is another function which able to do so also
hope this help.
-
March 29th, 2001, 07:26 AM
#3
Re: Remove ascii 00 in files
You can use REPLACE function too.
myString = replace(myString,chr(0),chr(32))
-
March 29th, 2001, 10:09 AM
#4
Re: Remove ascii 00 in files
Excelent! (I am out of vote for today)
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|