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


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

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

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 2011-12-12 09:52 -0600
Organization .
Message-ID <qo8ce7t7u30st1giu7dvos28l7i7mpipn3@4ax.com> (permalink)
References (1 earlier) <nospam-4A7111.23085411122011@news.aioe.org> <lc4ce71958l9ddrl1ukvbi87e4j6l97ta4@4ax.com> <jc5549$sj3$1@dont-email.me> <5f6ce7l4gdb41amj4bhlppuftosk95vq0n@4ax.com> <jc57jk$bhe$1@dont-email.me>

Show all headers | View raw


On Mon, 12 Dec 2011 10:45:56 -0500, Eric Sosman
<esosman@ieee-dot-org.invalid> wrote:

>On 12/12/2011 10:15 AM, Thee Chicago Wolf [MVP] wrote:
>> [...]  But as I've
>> asked other, using outFile.println yields me output in my file that
>> looks like so:
>>
>> file1.txt
>> <space>
>> file2.txt
>> <space>
>> file3.txt
>> <space>
>> <space>
>>
>> When I use outFile.write, I get:
>>
>> file1.txt
>> file2.txt
>> file3.txt
>> <space>
>>
>> I'm obviously going to stick with the cleaner looking output than the
>> one with extra spaces in it. But do you know why it's doing the extra
>> spacing with println? Realistically, it *should* just like the output
>> for what .write does. Any idea?
>
>     Debugging code that I can't see is an uncertain business, but
>I'll bet you did something like
>
>	outFile.println(filename + "\n");
>
>instead of just
>
>	outFile.println(filename);

Yes, Nigel pointed it out to me. .println with adding the \n will make
it work correctly. I'll fix it up. Thanks.

- 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