How to create folder names based on Excel values or Txt files?

Hi there,


I often need to create large numbers of folders based on names I have saved in an Excel spreadsheet. I know in windows there is a way to create a macro within excel that automatically generates folder names based on cell values.


I was therefore wondering how to do the same on a Mac operating system. The main thing is to find a way to automate the process. I understand this may involve copying the values to a text file.


Below is an example of the names I need to create folders for (copied from the excel spreadsheet):


Wash Bowl Small 600
Deck Mounted Wash Bowl 500
Wash Basin - 866 - 2 Shelves
Wash Bowl Large 800
Built-In Wash Basin With 1-Taphole
Deck Mounted Wash Bowl 625


Would really appreciate a simple step by step approach to an explanation. As my understanding of using Automator, Apple Script, Terminal, etc, is extremely basic.


Thanks and Best Wishes,


Graham

MacBook Pro

Posted on Feb 11, 2015 12:21 PM

Reply
3 replies

Feb 11, 2015 2:20 PM in response to Niel

Hi Niel,


Thanks again for another superb response. I have another question. Is it possible to automatically generate sub-folders along with the folder.


For example:


Folder Subfolder


Wash Bowl Small 600 > 2D CAD

3D CAD

***

Images

Brochures

Specifications

Technical

Case Studies

Operations


Deck Mounted Wash Bowl 500 > 2D CAD

3D CAD

***

Images

Brochures

Specifications

Technical

Case Studies

Operations


Above shows the 9 generic sub-folders I need to create within each folder that is generated.


Best Wishes,


Graham

Feb 11, 2015 2:27 PM in response to GrahamEvans

Here:


tell application "Finder"

set the_text to read (choose file)

set second_tier to {"2D CAD", "3D CAD", "***", "Images", "Brochures", "Specifications", "Technical", "Case Studies", "Operations"}

repeat with this_paragraph in paragraphs of the_text

set new_folder to (make new folder at window 1 with properties {name:this_paragraph})

repeat with second_folder in items of second_tier

make new folder at new_folder with properties {name:second_folder}

end repeat

end repeat

end tell


(122131)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to create folder names based on Excel values or Txt files?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.