Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > remove hidden characters from text file

Reply
Thread Tools Display Modes

remove hidden characters from text file

 
 
Dee
Guest
Posts: n/a

 
      07-10-2009

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
 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      07-10-2009


"Dee" <> wrote in message
news:22D27037-F366-461A-95A6-...
>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.


 
Reply With Quote
 
Dee
Guest
Posts: n/a

 
      07-10-2009

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


"Pegasus [MVP]" wrote:

>
> "Dee" <> wrote in message
> news:22D27037-F366-461A-95A6-...
> >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.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Notepad saving English text as Chinese Characters Roisin Windows Vista General Discussion 0 07-23-2008 10:57 PM
Check text file for text and move depending on if that text is fou ebferro Scripting 1 05-06-2008 05:40 AM
Replace multiple characters or strings in a text file John Scripting 8 11-09-2005 07:39 PM
Display of text (special characters) in IE Richard Cox Internet Explorer 4 07-09-2005 10:50 PM
Insert characters in text string Jeff Scripting 1 07-05-2004 10:34 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59