Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #25500

Re: Reading a text file

From bruce <bruceaj@bellsouth.net>
Newsgroups comp.lang.java.programmer
Subject Re: Reading a text file
Date 2011-02-11 20:53 -0800
Organization http://groups.google.com
Message-ID <846f12a8-521f-451d-88c5-3c0fb41c8b0b@o13g2000yql.googlegroups.com> (permalink)
References <19a4db14-7d28-465f-9f49-bdcee93a0ac7@s3g2000vbf.googlegroups.com> <64e6f4db-a931-400a-87d4-16da79e8af17@z31g2000vbs.googlegroups.com>

Show all headers | View raw


On Feb 11, 11:46 pm, bruce <bruc...@bellsouth.net> wrote:
> On Feb 11, 9:26 pm, bruce <bruc...@bellsouth.net> wrote:
>
>
>
> > I am reading a file with
>
> >     BufferedReader reader = null;
> >     StringBuffer contents = new StringBuffer();
> >     while ((text = reader.readLine()) != null) {
> >                 contents.append(text)
> >                     .append(System.getProperty(
> >                         "line.separator"));
> >                 }
>
> > This code reads the file fine.  My problem is that when I put the data
> > into a text, it is displayed with a space character before ever
> > character. (bruce => b r u c e)
>
> > What am I doing wrong??
>
> > Thanks...
>
> > Bruce
>
> I have just learned something. I don't know what it is but it appears
> that not all files give this space problem. I have loaded several
> other .txt files with no problem. So, I have some more testing to do
> before I can define the problem.
>
> Thanks..
>
> Bruce

Back to comp.lang.java.programmer | Previous | Next | Find similar


Thread

Re: Reading a text file bruce <bruceaj@bellsouth.net> - 2011-02-11 20:53 -0800

csiph-web