Page 5 of 29

Posted: Mon Dec 07, 2015 10:56 pm
by GORDON
SOMETHING was happening... when I went back to look at the script, the Excel process was all befucked... eventually it showed me that row A of the spreadsheet had an eternal line of 4-digit random numbers being generated. File names did not change.

Posted: Mon Dec 07, 2015 11:00 pm
by Malcolm
Holy christ. Just bust out the powershell and google.

Posted: Mon Dec 07, 2015 11:00 pm
by GORDON
I had to ctrl-alt-delete to close the runaway excel loop so I lost all the changes I was making to that script.

Posted: Mon Dec 07, 2015 11:02 pm
by TPRJones
Sounds like it didn't find the folder and ran on an empty set (so 65,536 lines worth in 2000, I believe). I didn't put error checking into it to watch for that.

Oh, well.




Edited By TPRJones on 1449547368

Posted: Mon Dec 07, 2015 11:31 pm
by Malcolm
Done, bitches. Powershell script that ought to work.

Replace "C:\testPs" with your root search directory. Tune the 1-100 RN range to your liking. The number generation isn't guaranteed to be unique, but a big enough range should handle that. The largest random value that can be generated is 2,147,483,647.

foreach ($file in Get-ChildItem "C:\testPs")
{
$r = Get-Random -minimum 1 -maximum 101
$name = $file.Name
$rname = "$r" + "$name"
$fullName = $file.FullName
Rename-Item "$fullName" "$rname"
}

There's probably a way to cram it all in one line, but fuck it.




Edited By Malcolm on 1449553192

Posted: Mon Dec 07, 2015 11:40 pm
by TPRJones
Do the filenames keep getting longer if you run it again to rerandomize?

Posted: Mon Dec 07, 2015 11:43 pm
by TheCatt
Why are you running Excell 2000, are you homeless?

Posted: Mon Dec 07, 2015 11:43 pm
by Malcolm
TPRJones wrote:Do the filenames keep getting longer if you run it again to rerandomize?

Argh. Fucking stupid MS string variable interpolation. The latest one I posted in should work without issue and won't make the names grow out to the right.

Uh, yeah, rerandomization would prepend new numbers. Without some file name convention, I can't parse the randomized names intelligently enough to reverse the op. If there's an ASCII character you can guarantee isn't used in your file names, I can key off that. Just blitz the files from the music player, recopy from the source, and randomize anew.




Edited By Malcolm on 1449553270

Posted: Tue Dec 08, 2015 8:26 am
by GORDON
TheCatt wrote:Why are you running Excell 2000, are you homeless?
IIRC Office 2000 was a massively pirated version of the software, before unique keys were a thing. And I pretty much LOL at anyone who thinks they need anything better than Word 2000 to write their grocery list on.

So yeah I was given a pirated copy of 2000 back in Memphis and I've never needed anything else.

Posted: Tue Dec 08, 2015 8:42 am
by GORDON
You fucking fuckers are fucking up my fucking fitness thread.

Posted: Tue Dec 08, 2015 9:23 am
by TheCatt
GORDON wrote:You fucking fuckers are fucking up my fucking fitness thread.
You started it.

And are lame for using Office 2000.

Posted: Tue Dec 08, 2015 10:47 am
by Malcolm
GORDON wrote:You fucking fuckers are fucking up my fucking fitness thread.
We already have one of those. Take your brain medicine.

Posted: Tue Dec 08, 2015 2:04 pm
by GORDON
TheCatt wrote:
GORDON wrote:You fucking fuckers are fucking up my fucking fitness thread.
You started it.
He drew first script, not me.

Posted: Tue Dec 08, 2015 2:04 pm
by GORDON
Today in the pool I was feeling blah. Two hour school delay means the day was fucked from the get-go... I guess I just do better before 9am that at noon.

Posted: Tue Dec 08, 2015 2:05 pm
by GORDON
Oh but the water headphones worked. I've got them back on the charger right now.

Posted: Tue Dec 08, 2015 2:10 pm
by Malcolm
GORDON wrote:Today in the pool I was feeling blah. Two hour school delay means the day was fucked from the get-go... I guess I just do better before 9am that at noon.

Really? I don't wake up until sometime around 2-3pm. I'm ambulatory and moving around, talking and all that other bullshit at 7-8am, but there's no synchronicity until the afternoon. Fuck mornings, they're made to be slept through.




Edited By Malcolm on 1449601829

Posted: Tue Dec 08, 2015 2:13 pm
by TheCatt
Yeah, I'm best at athletic stuff later in the day rather than earlier. I hate morning stuff.

Posted: Tue Dec 08, 2015 2:15 pm
by GORDON
I don't know. I just felt like I didn't have much power in the pool today.

Posted: Tue Dec 08, 2015 2:49 pm
by Malcolm
GORDON wrote:I don't know. I just felt like I didn't have much power in the pool today.
I've noticed my cardio results vary quite a bit, even when I keep my activity, sleep, and caloric intake roughly the same.

Posted: Tue Dec 08, 2015 2:53 pm
by TheCatt
GORDON wrote:I don't know. I just felt like I didn't have much power in the pool today.
1) Bad days happen.

2) Your body generally likes to do what it does at the same time.