Rebuild Client Directory with Empty Folders

Started by Slappy, December 04, 2019, 01:32:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Slappy

Short Ask: is there an easy way to duplicate hundreds (or more) folders but JUST the names?

Long Explanation: We're expanding our server storage and have decided we'd like to start "clean" with the exact same folder structure. Looking for a way to duplicate all the existing top-level folder names so we dn't have to manually make them all again. I know I can Copy-Paste folder names into a text doc, but not sure how to them re-populate a server structure with all those names.
A little diddie 'bout black 'n cyan...two reflective colors doin' the best they can.

Joe

Mac OS Sonoma 14.2.1 (c) | (retired)

The seven ages of man: spills, drills, thrills, bills, ills, pills and wills.

Slappy

Innnnntersting! I'll try it locally with a selection of folder names/folders first. Thanks!
A little diddie 'bout black 'n cyan...two reflective colors doin' the best they can.

DigiCorn

I really only need like 5-6 for each client, but I set it all up the way I want it and have it on the desktop. Then I just drag it to the server when I need it.
"There's been a lot of research recently on how hard it is to dislodge an impression once it's been implanted in someone's mind. (This is why political attack ads don't have to be true to be effective. The other side can point out their inaccuracies, but the voter's mind privileges the memory of the original accusation, which was juicier than any counterargument ever could be.)"
― Johnny Carson

"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut."
― Ernest Hemingway

Slappy

#4
Finally got around to needing this, and having the time to try it out - works kind of as expected, with a few extra steps.

That link that describes using Terminal is the right way, but it needs the folder structure listing to be on a single line, with each Folder in quotes (to preserve spaces in the names) and a space between each quoted Folder Name. So...enter TextMechanic website! I've used it for some other basic functions (ie number lists with prefix/suffix characters) but it will do 2 necessary things for this project:

Add Prefix/Suffix into Line - For the quotes before/after each folder name.

Add/Remove Line Breaks- Puts everything onto ONE line, and adds the necessary space between each.

THEN I ran the aforementioned Terminal command (cat dirlist.txt | xargs mkdir) and BAM! instant Folders galore. Sexah.  :banana: :banana:
A little diddie 'bout black 'n cyan...two reflective colors doin' the best they can.

swampymarsh

Hi Slappy,

The textmechanic website has helped me more than once before. Although this is an old topic, I thought that it was worthwhile adding another option.

This is also possible via a regular expression find/replace (like GREP in InDesign), which only needs a single command.

Find:
(.+)(\n)

Replace:
'$1'

Note, there is a word space at the end of the replace text, which I have attempted to show with the underline.

Attached is a screenshot from the regex101 website (one of many regular expression sites out there).