473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

System.IO.StreamReader is not returning single quotes from my file

I am using a System.IO.StreamReader to read a text file that was created
with Notepad. It is returning everything except the single quotes (at least
that is the only thing I have noticed it is not returning). The code I am
using is:

Dim poemstreamreader As System.IO.StreamReader

poemstreamreader = System.IO.File.OpenText(Global.Poems(poemtitle))

cellPoemText.Text = poemstreamreader.ReadToEnd()

poemstreamreader.Close()
I know that it is reading from the correct file, because it is returning all
the characters correctly, I simply need to know how to make it not discard
special characters such as single quotes. How do I do this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 21 '05 #1
2 1840
Nathan,

You mean something as
cellPoemText.Text = poemstreamreader.ReadToEnd()
poemstreamreader.Close()


cellPoemText.Text = cellPoemText.Text.Replace("'","")

I hope this helps,

Cor
Nov 21 '05 #2
"Nathan Sokalski" <nj********@hotmail.com> schrieb
I am using a System.IO.StreamReader to read a text file that was
created with Notepad. It is returning everything except the single quotes
(at
least that is the only thing I have noticed it is not returning).
The code I am using is:

Dim poemstreamreader As System.IO.StreamReader

poemstreamreader =
System.IO.File.OpenText(Global.Poems(poemtitle))
cellPoemText.Text = poemstreamreader.ReadToEnd()

poemstreamreader.Close()
I know that it is reading from the correct file, because it is
returning all the characters correctly, I simply need to know how to
make it not discard special characters such as single quotes. How do
I do this?

Don't know if this helps:

poemstreamreader = new io.streamreader(Global.Poems(poemtitle),
system.text.encoding.default)

This assumes ANSI encoding of the file.
Armin

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mudassar | last post by:
Hello I've been trying to figure this problem out for quite a while and I'm having no joy. I'll give you some background info, I'm creating a form and one of the fields in the form is a big ...
9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
3
by: Rene | last post by:
The documentation has the following remark for the ReadBlock method of the StreamReader: "The method blocks until either count characters are read, or all characters have been read". What kind...
2
by: Nathan Sokalski | last post by:
I am using a System.IO.StreamReader to read a text file that was created with Notepad. It is returning everything except the single quotes (at least that is the only thing I have noticed it is not...
7
by: Mike Joseph | last post by:
I have a data file that was produced in MicroSoft Access. It's a table that was exported as a fixed format, sequential access ASCII file. It contains over 80,000 records. Basically, all the stats...
4
by: George | last post by:
Hi, I am puzzled by the following and seeking some assistance to help me understand what happened. I have very limited encoding knowledge. Our SAP system writes out a text file which includes...
1
by: Arpan | last post by:
The contents of a text file are as follows: The Quick Brown Fox Jumped Over The Lazy Dog. Note that there isn't any space at the end of each of the 3 lines. Now when I do this:
1
by: AMP | last post by:
Hello, I am trying to see if a FileStream Opened using an"if" clause: FileStream infile = new FileStream("c:\\blink2.txt", FileMode.Open, FileAccess.Read, FileShare.Read); if (infile==0)..... ...
7
by: Mark Rae | last post by:
Hi, Has anyone successfully used the FTP stuff in the System.Net namespace against a VMS FTP server? I'm trying to do this at the moment and can't even get a directory listing, although there...
5
by: =?Utf-8?B?THVpZ2k=?= | last post by:
Hi all, with NUnit (C#) which is the better way to implement some tests to operate on a file in the file system? For instance: file exists, file read and file write. Thanks in advance. --...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.