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


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

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:46 -0800
Organization http://groups.google.com
Message-ID <64e6f4db-a931-400a-87d4-16da79e8af17@z31g2000vbs.googlegroups.com> (permalink)
References <19a4db14-7d28-465f-9f49-bdcee93a0ac7@s3g2000vbf.googlegroups.com>

Show all headers | View raw


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 | NextPrevious in thread | Next in thread | Find similar


Thread

Reading a text file bruce <bruceaj@bellsouth.net> - 2011-02-11 18:26 -0800
  Re: Reading a text file bruce <bruceaj@bellsouth.net> - 2011-02-11 20:46 -0800
  Re: Reading a text file Roedy Green <see_website@mindprod.com.invalid> - 2011-02-11 20:12 -0800

csiph-web