Recent

Author Topic: Rebuild Client Directory with Empty Folders  (Read 7526 times)

0 Members and 1 Guest are viewing this topic.

Offline Slappy

  • Ninja Member
  • *
  • Posts: 4365
  • Gender: Male
  • Come On. Fhqwhgads.
  • Gender: genderless
Rebuild Client Directory with Empty Folders
« on: December 04, 2019, 02:32:55 PM »
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.

Offline Joe

  • Master of Nothing
  • Administrator
  • Ninja Warlord
  • *****
  • Posts: 38677
  • Gender: Male
    • B4Print.com
  • Gender: male
Re: Rebuild Client Directory with Empty Folders
« Reply #1 on: December 04, 2019, 03:25:00 PM »
Mac OS 11.5.2 Big Sur | Prinergy 9.0.1.125 | Adobe Creative Cloud 2021 | TWO Fuji CTP Units

I'm Sorry I Hurt Your Feelings When I Said You Were Stupid. I Honestly Thought You Already Knew

Offline Slappy

  • Ninja Member
  • *
  • Posts: 4365
  • Gender: Male
  • Come On. Fhqwhgads.
  • Gender: genderless
Re: Rebuild Client Directory with Empty Folders
« Reply #2 on: December 04, 2019, 08:41:36 PM »
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.

Offline DigiCorn

  • Terrorizing humans since 1971
  • Supreme Ninja
  • ***
  • Posts: 15982
  • Gender: Male
  • There is no Dana, only Zul!
    • Clerks.
  • Gender: undisclosed
Re: Rebuild Client Directory with Empty Folders
« Reply #3 on: December 05, 2019, 12:43:00 PM »
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.
"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

Offline Slappy

  • Ninja Member
  • *
  • Posts: 4365
  • Gender: Male
  • Come On. Fhqwhgads.
  • Gender: genderless
Re: Rebuild Client Directory with Empty Folders
« Reply #4 on: May 27, 2020, 01:22:55 PM »
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:
« Last Edit: May 27, 2020, 08:31:23 PM by Slappy »
A little diddie ‘bout black 'n cyan...two reflective colors doin’ the best they can.

Offline swampymarsh

  • Full Member
  • ***
  • Posts: 165
Re: Rebuild Client Directory with Empty Folders
« Reply #5 on: February 06, 2021, 06:07:22 PM »
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).