Path: news.nzbot.com!news.astraweb.com!border5.newsrouter.astraweb.com!feed.news.qwest.net!mpls-nntp-06.inet.qwest.net!club-internet.fr!feedme-small.clubint.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!69.16.173.12.MISMATCH!news-in-01.newsfeed.easynews.com!easynews!core-easynews-01!easynews.com!en-nntp-01.dc1.easynews.com.POSTED!not-for-mail
From: lurkmeister <not@home.com>
Newsgroups: alt.binaries.pictures.webeweb
Subject: Re: Did you ever felt the need to move a collection to the parent folder?
Message-ID: <g2rsa59dqpt5g7c5ehvpbsj8ui4g53pkfa@4ax.com>
References: <NcSdncgzbb5nVjHXnZ2dnUVZ8vGdnZ2d@giganews.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 161
X-Complaints-To: abuse@easynews.com
Organization: EasyNews, UseNet made Easy!
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Mon, 14 Sep 2009 13:22:20 -0400
Xref: news.nzbot.com alt.binaries.pictures.webeweb:947
On Sun, 13 Sep 2009 10:40:33 GMT, "NottyBrother"
<NottyBrother@SisterBedroom.luv> wrote:
>Explaining better:
>
>when you download rars with folders like this:
>
>
>+---Model Name
>| +---Members
>| | +---001
>| | \--- Images
>| | +---002
>| | \--- Images
>| | +---003
>| | \--- Images
>
>etc...
>
>
>
>And you would like to have
>
>+---Model Name
>| +---001
>| +---002
>| +---003
>
>etc...
>
>where the images are inside the 001, 002 and 003 folders?
>
>Do you know how to do this recursively and automatically? :)
jorj's solution works for Linux, but you can do something similar
under Windows.
It's easier if you have one of the Power Toys for XP which adds a
"open command window here" when you right-click a folder. Or you can
do it the old fashioned way by Start/Run/cmd (i.e. create a
command-line "dos box" window.
If you've rarely or never messed with the command line, the first
thing you should do is type (without the quotes) "prompt=$p$g" (no
spaces), which will give you a prompt that shows exactly which
drive:\folder\sub-folder your'e in, like this:
c:\windows>
, although you might start from a different folder. It depends on your
setup.
After that, go to Model Name\members (using your above example). If
it's on (say) your D: drive, and you have a Webe folder, (i.e.
d:\webe\Lacey, d:\webe\Sherrie, etc), you would first type the drive
letter (if it's all on C:, you can skip this step), such as D:, E:, or
so on, on the command line, then press the <Return> key. You should
then see something like "D:\>"
After that, type cd (which means Change to Directory) Model\members.
If that's a subfolder itself (as in my above example) you would have
to type the full listing such as -cd webe\model\members- (no hyphens).
The nice thing is that if you just type the start of a folder name,
then press the <Tab> key, it will complete the folder name, so you
could type something like -cd we<Tab> Mod<Tab>, and so on to save some
typing. For my example I abbreviated "model name" to "model."
NOTE the above is only an example. You need to enter the actual
pathname for your setup. You can use the <Tab> method I described
above for the full path, or you can open Windows Explorer, click on
the appropriate folder, and the Address line will show the full path.
If you REALLY hate typing, you can Control-C copy the pathname from
the Address bar, switch to the command-line box, right-click just
after you entered "cd" (no parentheses), and select Paste. Whatever
works best for you.
I read it correctly, the sub-folders are set up as
Model\members\001\*.jpeg, Model\members\002\*.jpeg, and so on. This
numbering makes it fairly simple. :)
First step is: the Windows command line doesn't understand leading
zeros in a "FOR" loop, so you'll have to do 1..9, then 10..99, then
100..nnn. That's not too bad, since (if you've never used the command
line) there's a recall function; just press the up-arrow cursor key,
and the last-entered command will show up on again. You can edit it
for each of the above iterations. How high you go depends on how many
numbered folders there are.
you might want to cut'n'paste a couple folders to a test folder to
make sure you typed the below commands correctly. Once you're sure of
that you can return to \members and run the same commands there.
remember, do this from your members folder.
So. First we have
for /L %f in (1,1,9) do move 00%f ..
(note the space between %f and .. )
the /L tells the batch processor to treat the values in the
parenthesis as loop values. In this case from 1 to 9 in steps of 1.
move 00%f should successively move folders 001, 002 ..009 to the
parent folder (..), in this case from members to Model. the
leading zeros in 00%f are needed because the Windows batch processor
(shut UP, jorj! {g}) isn't smart enough to understand 001, 002, and so
on. Ok?
after that, press the up-arrow key, and the above line will appear
after the prompt. you can edit the command via the right left cursor
keys, and using backspace and/or Delete. you start in "insert" mode
(just like insert mode in a word processor), and you can switch to
overwrite mode by pressing the <Ins> key. Just like a word processor.
:) I would avoid overwrite for now. Just left-arrow over to the
(1,1,9), change the first 1 to 10, and 9 to 99 like so (10,1,99). If
you have less than 99 folders (say up to 067) then use that number
instead, so it would look like (10,1,67)
then right-arrow over to the 00%f part, and delete one zero, so it
looks like 0%f. After this, the line should look like:
for /L %f in (10,1,99) do move 0%f ..
again, replace 99 with something else for fewer folders
this should move folders 010 to 0nn to the parent folder as well.
If, lord forbid, you have more than 99 folders, after the above
completes, hit up-arrow again, and re-edit the line to look like:
for /L %f in (100,1,xxx) do move %f ..
where xxx is the highest numbered folder.
Short form:
-Start/Run/cmd
-type the line prompt=$p$g, press<Enter> (i.e. press the <Enter> key)
-change to the drive where the folder is (eg D: or E:, etc). Skip if
everything is on C:
-type cd foldername\subfolder\etc\Model\members, press <Enter>
NOTE: above is "for example" ONLY
-type for /L %f in (1,1,9) do move 00%f .. press <Enter>
-recall command by pressing up-arrow, edit to:
for /L %f in (10,1,99) do move 0%f .. press <Enter>
-recall command by pressing up-arrow, edit to:
for /L %f in (10,1,999) do move 0%f .. press <Enter>
You can, of course, replace 99 or 999 with the appropriate
highest-numbered folder.
If I'm telling you things you already know, I apologize, but I didn't
want to assume *any* knowledge. And -maybe- there's a complete newb
out there who could use that much detail. Heh.
You can learn more by googling "windows command line" and/or "windows
for command"
Hope this helps.
|
|