in reply to Read contents of multiple files into new file and then move source files?

cat /files/* > new-file.txt && mv /files/* /new-folder/

Ahh but you're on Windows...

  • Comment on Re: Read contents of multiple files into new file and then move source files?
  • Download Code

Replies are listed 'Best First'.
Re^2: Read contents of multiple files into new file and then move source files?
by aaron_baugher (Curate) on Feb 10, 2012 at 23:20 UTC

    Wondering: Is it possible for a file to be created after the first wildcard is interpreted, but before the second, so a file would get moved that wasn't catted?

    Aside from being on Windows, he's also talking about thousands of files, so a shell might balk at that many anyway. That'd lead to using find, which done right should eliminate any concerns about moving unprocessed files.

    Aaron B.
    My Woefully Neglected Blog, where I occasionally mention Perl.

      Yes, yes, and yes.

      You get my ++ upvote across the board. My reply was hasty and without caffeine.