You should look into saving the file with the proper encoding.
I suspect that your file I/O is saving the file in the default system
encoding(probably Unicode)
and what you need is ASCII or something similar.
You need to explicitly write the file with a specific encoding(from
System.Text.Encoding).
You need to write it using a StreamWriter object.
here's the code to get you started:
Dim fs As FileStream = File.Create("MyFileName")
'I specify the encoding with which the file will be written in the second
constructor parameter
Dim writer As StreamWriter = New StreamWriter(fs,
System.Text.Encoding.ASCII)
writer.Write(MyText)
writer.Close()
Should be short and simple after that.
--
Regards,
Roy Osherove
http://www.iserializable.com
---------------------------------------------
"Maya" <ma********@us.pwcglobal.com> wrote in message
news:71*************************@posting.google.co m...
Hey, there!
I'm new to vb.net and it seems I wouldn't be able to solve this
without help.
I have a pipe delimited file that has to be saved in txt format
so it could be accepted by my DTS package.
If I open and save the file manualy in Wordpad - it works.
(not in Notepad otherwise formatting is changed and DTS package
won't accept it.)
File.Copy(strPath,strTxtPath) method of System.IO - creates the copy
of the file with .txt extension as needed,but format is like in
notepad - all screwed.
I need the file to be opened and saved in Wordpad format
programmaticaly.
I'd really appreciate if anyone who knows how to do it let me know.
Thank you very much.