Discussion:
remove hidden characters from text file
(too old to reply)
Dee
2009-07-10 08:55:01 UTC
Permalink
I need to remove any hidden characters from my text file.

The text file lists server names on sperate lines, however after the the
very last line there seems to be a hidden character.

I thought it was a carrige return and found some vb script code to remove
the hidden characters , but then all my server names are listed on one line.
And my program cannot use the file.

Does anyone know of a way of getting any unwanted charcters removed from a
end of file.

Rgds

D
--
Dee
Pegasus [MVP]
2009-07-10 10:27:36 UTC
Permalink
Post by Dee
I need to remove any hidden characters from my text file.
The text file lists server names on sperate lines, however after the the
very last line there seems to be a hidden character.
I thought it was a carrige return and found some vb script code to remove
the hidden characters , but then all my server names are listed on one line.
And my program cannot use the file.
Does anyone know of a way of getting any unwanted charcters removed from a
end of file.
Rgds
D
Let's have a look at the first 10 and the last 10 characters in your text
file. You can get them by using the ReadAll method of the File System
Object, then using the ASC function to report the ASCII numbers for these 20
characters. If the ReadAll method does not work then you need to use the
Read(x) method where x=size of your file.
Dee
2009-07-10 13:46:01 UTC
Permalink
The text file is just a list of servers names and this will vary. The program
just pings the servers in the list, then writes to another log file if its
online or offline.

Thanks for the ASC function, I will have a look at this , did not know about
it.

rgds
--
Dee
Post by Pegasus [MVP]
Post by Dee
I need to remove any hidden characters from my text file.
The text file lists server names on sperate lines, however after the the
very last line there seems to be a hidden character.
I thought it was a carrige return and found some vb script code to remove
the hidden characters , but then all my server names are listed on one line.
And my program cannot use the file.
Does anyone know of a way of getting any unwanted charcters removed from a
end of file.
Rgds
D
Let's have a look at the first 10 and the last 10 characters in your text
file. You can get them by using the ReadAll method of the File System
Object, then using the ASC function to report the ASCII numbers for these 20
characters. If the ReadAll method does not work then you need to use the
Read(x) method where x=size of your file.
Loading...