By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

Read File from vb.net

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Stan,

Probably you have to find how it is encoded and than you can use the right
encoding.

This page describes the start of your puzzle.

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps?

Cor
Nov 21 '05 #2

P: n/a
On Mon, 4 Oct 2004 08:32:36 +0200, "Stan Sainte-Rose"
<st**@cyber972.com> wrote:
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.
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.