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


Groups > comp.lang.java.help > #1441

Re: Easy way to read the contants of a folder/directory and output contents to file?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.alt.net!news-out.readnews.com!transit3.readnews.com!s09-11.readnews.com!unm2.readnews.com.POSTED!not-for-mail
X-Trace DXC=FZJNo\iAN3M<JIhTL1E5]Ok\2KDSF=2@BFV0LA4MIjQKmTIDj6@1WaL^]]CW6JBjaITA`X]=O@ZUNb;DR]B5Ic1M>^c`n\HHe@Co3R^HBiTkAH:Wa6U]`:5EBLoRkGiP7ZWC
X-Complaints-To killthespammer@usenetmonster.com
From "Thee Chicago Wolf [MVP]" <.@.>
Newsgroups comp.lang.java.help
Subject Re: Easy way to read the contants of a folder/directory and output contents to file?
Date Mon, 12 Dec 2011 10:54:10 -0600
Organization .
Reply-To .
Message-ID <k5cce75e2aqlfk5vmqvsll2jopa48hj3bc@4ax.com> (permalink)
References <e5rae71q7jppj0ms8jn0sc0qp636gn3csj@4ax.com> <dir-20111212093056@ram.dialup.fu-berlin.de> <hn4ce7t0gdu40rgrfaj9546mepb3kcnhm7@4ax.com> <m3obvdpxkz.fsf@despammed.com>
X-Newsreader Forte Agent 6.00/32.1186
X-No-Archive yes
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Lines 28
NNTP-Posting-Host b559f588.newsreader.readnews.com
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:1441

Show key headers only | View raw


On Mon, 12 Dec 2011 18:24:28 +0200, Jukka Lahtinen
<jtfjdehf@hotmail.com.invalid> wrote:

>"Thee Chicago Wolf [MVP]" <.@.> writes:
>
>> A lot cleaner. In my original code, I used outFile.write. Just for my
>> own knowledge, any idea why outFile.println versus outFIle.write would
>> make the output look different?
>
>Not before you actually show us your code with println calls.

A couple others did figure it out. When using .write, it's not adding
the extra "\n" whereas with .println, the "\n" was adding an extra
line so that was the issue.

Realistically, these two statements work exactly the same:

outFile.print(String.valueOf(list[i]+"\n"));
outFile.write(String.valueOf(list[i]+"\n"));

but this one gives me and extra line:

outFile.println(String.valueOf(list[i]+"\n"));

That was the issue, the "\n". It wasn't needed when used with
.println.

- Thee Chicago Wolf [MVP]

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf (MVP)" <.@.> - 2011-12-11 21:06 -0600
  Re: Easy way to read the contants of a folder/directory and output contents to file? "John B. Matthews" <nospam@nospam.invalid> - 2011-12-11 23:08 -0500
    Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 08:42 -0600
      Re: Easy way to read the contants of a folder/directory and output contents to file? Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-12-12 14:49 +0000
        Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 09:12 -0600
          Re: Easy way to read the contants of a folder/directory and output contents to file? Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-12-12 15:44 +0000
            Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 09:51 -0600
      Re: Easy way to read the contants of a folder/directory and output contents to file? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-12-12 10:03 -0500
        Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 09:15 -0600
          Re: Easy way to read the contants of a folder/directory and output contents to file? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-12-12 10:45 -0500
            Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 09:52 -0600
  Re: Easy way to read the contants of a folder/directory and output contents to file? Roedy Green <see_website@mindprod.com.invalid> - 2011-12-12 01:02 -0800
    Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 09:19 -0600
  Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 09:08 -0600
    Re: Easy way to read the contants of a folder/directory and output contents to file? Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2011-12-12 18:24 +0200
      Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 10:54 -0600
        Re: Easy way to read the contants of a folder/directory and output contents to file? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-12-12 12:40 -0500
          Re: Easy way to read the contants of a folder/directory and output contents to file? "Thee Chicago Wolf [MVP]" <.@.> - 2011-12-12 12:03 -0600
          Re: Easy way to read the contants of a folder/directory and output contents to file? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-12-12 13:04 -0500

csiph-web