I must respond with a Sorry to All..
I re-read his original post and found that the file naming criteria he
requested
would not work in this QuickNDirty.BTM
a) xxxxxx_0001.jpg, xxxxxx_0001.jpg,xxxxxx_0001.jpg
all the same endpoints 0001.jpg
QuickNDirty was expecting _0001.jpg _0002.jpg etc.. in auxiliary file
"input.dat"
Sorry Steve .. and anyone else who thought I was an idiot.
----- Original Message -----
From: "Rex Clark" <>
To: <
[email protected]>
Sent: Tuesday, June 17, 2008 2:47 PM
Subject: RE: [Support-t-199] Re: renaming files
: ---Quote (Originally by Steve Fábián)---
: Rex Clark wrote:
: |
: | QuickNDirty.BTM
: |
: | dir /b *.jpg >input.dat
: |
: | do r=0 to %@lines[input.dat]
: | set fifo=%@line[input.dat,%r]
: | ren /N %fifo %@instr[%@inc[%@index[%fifo,_]],,%fifo]
: | enddo
:
: Your method is very slow because of the manner @LINES works. Furthermore,
: splitting the name via @INSTR[] after locating the proper location using
: @INDEX is superfluous according to the file name formats in the modified
OP.
:
:
: An equivalent method, without the need for the auxiliary file, is in my
: response to the OP.
:
: |
: | "NOTE" /N(othing) after "ren"ame remove "/n" when you are sure this
: | is what you want it to do.
:
: An excellent point. I usually put the /n at the tail end of the command
: (esp. interactively) for easier removal.
: --
: Steve
: ---End Quote---
: Why would %@lines matter it only needs to know how many lines to read in
the file .. it s only done once. so theres 2343 lines it takes less than 2
seconds to get what it needs to continue.
:
: as for %@line[] its got its filename "%r" profides the next line number
:
: I could of used fileread/open/seek
: To much syntax for a simple job when the above does what its told ...
given the translation i got from his original post in regards to his file
re-naming criteria. it was "QuickNDirty" no testing of complex regexp
:
: regular expressions would of work too
:
: I find having code/scripting whatever easier todo if the code itself was
more descriptive than writting "comments under or above the syntax to
explain what it does". I hate comments they are sometimes more confusing
than the actual code. But thats just me.
:
:
:
:
: