Hello, some charitable soul can help me with this.
I would like to randomize the names of some files. But between them. Example:
Normal
A.png - B.png - C.png
Random
B.png - A.png - C.png
The images have not been modified. Just the name of them. It will be in my heart to help me with this. Thank you.
Yes, Node.js can do this easily in under 25 lines.
I have no experience programming.
Only "very little" java (if, switch, else, void)
Yes, you can do this easily in any programming language.
>get list of all file names in folder
>randomize the order of that list
>go through the original list of files, and rename it from the randomized list
>e.g. If you're on file 5, you select the 5th item from the randomized list
Try to do one of those things at a time. You can use Ruby, Python (easy), or the operating system command line scripting (batch in Windows, bash in Linux).
>not fully tested. use at your own risk
#!/bin/bash
ls > /tmp/originalnames.txt
ls | while read line; do echo `echo $line | md5sum | cut -d' ' -f1`\|$line; done | sort | cut -d'|' -f2 > /tmp/targetnames.txt
mkdir renamed
paste /tmp/originalnames.txt /tmp/targetnames.txt | while read line; do src="`echo "$line" | cut -f1`"; dst="`echo "$line" | cut -f2`"; mv "$src" renamed/"$dst"; done
>>61132639
I do not know where to put all that.
I just started all this programming. That's why my name "Newbie"
>>61132728
It's a bash script. It should work on linux and mac. If you're on windows, use Bash for Windows.
Open a terminal, change directory (cd) to the directory containing the files you want to rename, and run the commands line by line.
>>61132728
Your first step is to install Gentoo
>>61132771
That's still to advanced for him
Though CBA to explain it myself
OP, just study programming some more, in a month you'll easily be able to write it yourself
>>61132771
I do not understand the program. I'm still new to this. Same thanks for the help. I hope someone else will help me. Is there any subreddit where I can ask for help?
A few lines in bash should be enough
#!/bin/bash
name=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1)
ext=$(echo "$1" | cut -d'.' -f 2)
mv "$1" "$name.$ext"
echo "Renamed to: $name.$ext"
you mean like this?
>>61135687
nevermind i didnt read the entire op
>>61132477
>easily in under 25GB of code.
fixed that for you
>>61132462
A bit like this I guess. There's probably easier ways
>>61132462
Made something like this a few years ago when I was a Winfag for game modding. Here it is, Windows only.
https://lewd.pics/chan/b/27.html
>>61132477
With a small 300-sized dependency tree.
>>61132462os.mkdir('output')
files = glob.glob('*.png')
shuffled = random.sample(files, len(files))
for i in range(len(files)):
os.rename(files[i], 'output' + shuffled[i])
for f in files:
os.rename('output' + f, f)
I haven't tested it cuz >phoneposter
>>61136387
What programs is it?