remove hidden characters from text file

Discussion in 'Scripting' started by Dee, Jul 10, 2009.

  1. Dee

    Dee Guest

    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.


    Dee, Jul 10, 2009
    1. Advertisements

  2. 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.
    Pegasus [MVP], Jul 10, 2009
    1. Advertisements

  3. Dee

    Dee Guest

    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

    Dee, Jul 10, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.