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

probleum in reading the data from a .val file

100+
P: 198
Hi
i have some probleum in reading the data from .val extension file
when i manually open the file in notepad and just click on file option -> save -> close the txt file and then read the data from vb.net coding it works fine but when i read the data from the selected file directly from coding it reads only first two characters
what is this means i use the following coding
sPathName = txtpath.Text & "\" & sFolderArray(icount) & "\" & sFolder
StmReader = New StreamReader(sPathName)
str = ""
Do
file1 = StmReader.ReadLine
txtfile.Text = txtfile.Text & file1
str = str & file1
Loop Until file1 Is Nothing
StmReader.Close()

is there any method to open and then save the file before readign from the file
please tell me

varinder
Jun 16 '08 #1
Share this Question
Share on Google+
3 Replies


Plater
Expert 5K+
P: 7,872
That sounds like the file is saved as a UTF file or something and by re-saving in notepad you save it as an ascii file.
It reads in the byte order mark and decides its a "nothing" string and your function exits?
Jun 16 '08 #2

100+
P: 198
thanks for reply
can you tell me how i can do this


That sounds like the file is saved as a UTF file or something and by re-saving in notepad you save it as an ascii file.
It reads in the byte order mark and decides its a "nothing" string and your function exits?
Jun 17 '08 #3

Plater
Expert 5K+
P: 7,872
Open the file as UTF16 (or one of the other formats)
Jun 17 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.