vipinkrshamra
Programmer
Hi!,
I am trying to read txt file from .Net app using following code.
*****code****
Dim myReader As New System.IO.StreamReader(FileName, System.Text.Encoding.Default)
While myReader.Peek <> -1
mystring = myReader.ReadLine
End While
*****code****
This txt file is created by some 3rd party application from some database. One of the field which is added to file may have line feed character.
If this file is opened in notepad, the line, which may have some sort of line feed character, appears fine in single line with that special character appearing as small square box type character.
But if I read this txt file using StreamReader this line break into two line and which breaks my logic. Is there anyway to ignore any special character while reading txt file using StreamReader . This txt file may have 1000's of line and each file need to processed seperately. Because of this special character StreamReader reads some lines as multile line instead of single line. Since notepad is able to display that line in single line itself I am assuming, using StreamReader also I should be able to ignore that character. I tried using System.Text.Encoding.Default but that did not help.
Any suggestion/help would be greatly appreciated.
Thanks,
Vipin
I am trying to read txt file from .Net app using following code.
*****code****
Dim myReader As New System.IO.StreamReader(FileName, System.Text.Encoding.Default)
While myReader.Peek <> -1
mystring = myReader.ReadLine
End While
*****code****
This txt file is created by some 3rd party application from some database. One of the field which is added to file may have line feed character.
If this file is opened in notepad, the line, which may have some sort of line feed character, appears fine in single line with that special character appearing as small square box type character.
But if I read this txt file using StreamReader this line break into two line and which breaks my logic. Is there anyway to ignore any special character while reading txt file using StreamReader . This txt file may have 1000's of line and each file need to processed seperately. Because of this special character StreamReader reads some lines as multile line instead of single line. Since notepad is able to display that line in single line itself I am assuming, using StreamReader also I should be able to ignore that character. I tried using System.Text.Encoding.Default but that did not help.
Any suggestion/help would be greatly appreciated.
Thanks,
Vipin