Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!z31g2000vbs.googlegroups.com!not-for-mail From: bruce Newsgroups: comp.lang.java.programmer Subject: Re: Reading a text file Date: Fri, 11 Feb 2011 20:46:06 -0800 (PST) Organization: http://groups.google.com Lines: 29 Message-ID: <64e6f4db-a931-400a-87d4-16da79e8af17@z31g2000vbs.googlegroups.com> References: <19a4db14-7d28-465f-9f49-bdcee93a0ac7@s3g2000vbf.googlegroups.com> NNTP-Posting-Host: 72.145.249.140 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1297485966 22801 127.0.0.1 (12 Feb 2011 04:46:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 12 Feb 2011 04:46:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z31g2000vbs.googlegroups.com; posting-host=72.145.249.140; posting-account=mf1brAkAAABFHW7KlcqUMF6vmODE2KZM User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C),gzip(gfe) Xref: csiph.com comp.lang.java.programmer:26055 On Feb 11, 9:26=A0pm, bruce wrote: > I am reading a file with > > =A0 =A0 BufferedReader reader =3D null; > =A0 =A0 StringBuffer contents =3D new StringBuffer(); > =A0 =A0 while ((text =3D reader.readLine()) !=3D null) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 contents.append(text) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .append(System.getProperty( > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "line.separator")); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > This code reads the file fine. =A0My problem is that when I put the data > into a text, it is displayed with a space character before ever > character. (bruce =3D> 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