in reply to new directory with sorted files

Perl? Use bash.

mkdir WEIGHT mv WEIGHT_HEIGHT/*weight* WEIGHT mv WEIGHT_HEIGHT HEIGHT

Replies are listed 'Best First'.
Re^2: new directory with sorted files
by mikeraz (Friar) on Apr 05, 2012 at 23:23 UTC

    Sure you can use the local shell. But where's the Perl learning opportunity in that? As a side note both of the previous examples will work without bash.


    Be Appropriate && Follow Your Curiosity

      But where's the Perl learning opportunity in that?

      Using the correct tool for the job is a lesson that also applies to Perl.

      As a side note both of the previous examples will work without bash.

      I don't get your point. As far as I can tell, you are falsely implying it will work with all interpreters or shells, or you expect me to list all of them in which the code will work even though I don't know that list.

Re^2: new directory with sorted files
by pvaldes (Chaplain) on Apr 07, 2012 at 00:31 UTC

    Same opinion, if you can, use bash for this. You can use perl of course, just remember that all files in your directory will be always sorted, so you don't need really to care about this. If you want to do this with perl take a look to mkdir and rename. If you use copy instead rename you'll need also to use unlink (that can be a little scary for a novice)