You have a list of files: file1.jpg, file5.jpg, file9.jpg You need change their filenames so that they are in sequential order, without any numerical gaps.
file1.jpg, file2.jpg, file3.jpg
You may only use a windows .bat script to accomplish the task.
I use vim to copy and modify the line a million times with a single macro
Logan Lee
retard
Lincoln Baker
power shell Dir | %{Rename-Item $_ -NewName ("file{0}.jpg" -f $nr++)}
Brandon Campbell
overwrites existing files
Hudson Gonzalez
your problem not mine
Adrian Turner
x = 1 y = 1 z = true while z if exists(file$x.jph) do rename(file$x.jpg, file$y.jpg) else z = false done x = x + 3 y = y + 1 done I even remember you incremented the file names by 3. You don't get batch though because I don't know it.
Andrew Bailey
Let's see if I still remember some batch after all those years (not on Windows so I can't test it beforehand). @echo off SETLOCAL EnableDelayedExpansion
SET /A "_counter=0" FOR %%A IN (*.jpg) DO ( SET /A "_counter+=1" REN "%%A" !_counter!.jpg )
Oliver Morris
>windows cortana can't do this for you?
Brayden Hughes
based retard
Carter Scott
I would unironically use irfanview batch rename because its a GUI without all this gay command line stuff.
Kevin Sanders
Figure it out on your own, faggot. The absolute state of Jow Forums man.. can't even use an internet search engine
Alexander Jenkins
That probably won't work, because.... Why the fuck do you have exclamation marks?
Also, I tried like this exact solution once, and I got poopity poop.
Thomas Hernandez
>That probably won't work Very likely. It's been years since I last used Windows and wrote batch scripts. >Why the fuck do you have exclamation marks? Because of EnableDelayedExpansion. %_counter% would be 0 every time. !_counter! gets incremented by one with each loop.
Eli Bailey
I might love you, you old bastard. God damn web guides leave out little important details like this.
Jacob Brooks
DO YOUR OWN HOMEWORK NIGGER DIE DIE DIE PLESE DIE
Xavier Gomez
This isn't homework.
Connor Perez
OP here, this was 100% what I needed.
I was so close to figuring that out on my own, but the information I was using online neglected to mention the VERY IMPORTANT need of those EXCLAMATION MARKS! XD
My code is performing exactly to my desires now.
Connor Jenkins
>XD >windows .bat script kill yourself
Jaxon Flores
It's not your code it's code you copied and pasted from Jow Forums.
Isaiah Edwards
I would, but it would require a privilege escalation. Asimov's four laws of robotics prohibits this.
Mason Adams
>implying I used his code directly
Why the fuck would I want all capitals in my script? I needed the !variablehere! delimiter syntax, not his style/lack of style.
I was just sitting here thinking, damn, this mofo is a DOS dev, all them caps baby.
My script command looks nothing like homedawg's example.
Brayden Hall
do share your solution
Connor Davis
If you want to get hyper technical though.
It's nobody's code, because you can't own concepts.
Software instructions are just guides for how to do something, and are not a tangible asset to themselves.
Any user is free to use free code, and this forum expounds no tangible ownership to what are at it's core, just mathematical concepts.
and programmers wonder why everyone thinks they're cunts
Levi Rodriguez
OPs just trying to organize his p0rn library fag. Fuck off if you can't help.
Samuel Scott
OP here, I have noticed an issue.
It seems that file31.png is being processed AFTER file100-299.png is processed, thus making the end result out of order...
Can I make it process these in an order dependent on the numerical value, and not just off of whether or not the first digit character is alphanumerically after the other?
Thomas Campbell
>Can I make it process these in an order dependent on the numerical value, and not just off of whether or not the first digit character is alphanumerically after the other? Not that I know of. However you could adjust the for loop to loop through the numbers used in the input filenames instead of the files themselves. FOR /L %%A IN (, , ) DO ( )
Liam Wood
Yeah, that's what made my problem in the first place.
(1,3,300)
Gotta have that 3
Samuel Brooks
Thanks, didn't do exactly what you said, but that helped me figure out what to do.