Read File from vb.net

  • Thread starter Thread starter Stan Sainte-Rose
  • Start date Start date
S

Stan Sainte-Rose

Hi,

I need to read a kind of text file from vb.net
I do know how to read a simple file, but this one seems to have special
characters.
Some characters appears like squares when open this file with notepad.
When I read the file from vb, I just have the last square.
How to avoid this and remove all the squares ?
Thanks for your help

Stan
 
Hi,

I need to read a kind of text file from vb.net
I do know how to read a simple file, but this one seems to have special
characters.
Some characters appears like squares when open this file with notepad.
When I read the file from vb, I just have the last square.
How to avoid this and remove all the squares ?
Thanks for your help

Stan

Are these squares fwhere you would expect the end f line to be? Or do
you know if the file was created on a Unix system?

IF this is a Unix sources file then it is probable that the squares
represent the LF (Line Feed) character (ASCII 10). Unix generated
these in addition to the DOS/Win CR character (ASCII 13). If you have
access to this system, or can contact the file originatior then get
him to pass it through the xx2dos (HP-UX) command to strip these LF's
out. Other Unix variants should have a similar command.

If it'd not a unix command, the substring out the character showing as
a square and find it's ASCII value, then dump all characters with that
code.

This may/may not be of help, sorry I can't supply any code snippets at
the moment as I am on my laptop not my dev machine.

Rob.B.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top