![]() |
Generate folders from spreadsheet? - Printable Version +- MacResource (https://forums.macresource.com) +-- Forum: My Category (https://forums.macresource.com/forumdisplay.php?fid=1) +--- Forum: Tips and Deals (https://forums.macresource.com/forumdisplay.php?fid=3) +--- Thread: Generate folders from spreadsheet? (/showthread.php?tid=117110) Pages:
1
2
|
Generate folders from spreadsheet? - Dik2 - 05-17-2011 I need to generate a set of folders whose names consist of two columns of the spreadsheet (Name+zip). I have Office and iWork, but no skills with them. Can this be done simply? Re: Generate folders from spreadsheet? - Seacrest - 05-17-2011 It can be done fairly simply, probably. How many lines are we talking about? Are you trying to recursively create directories (dirs within dirs) or is it a flat structure? If it were me, I'd just prepend "mkdir" to a concatenated form of "name + zip";, copy it all and paste into a shell (after changing to the destination parent directory). If the resultant folder names have spaces, I would surround them with dbl quotes, like so: mkdir "name 00812"; If the above all sounds Greek to you, then there might be other GUI solutions that someone else could post. Re: Generate folders from spreadsheet? - Dik2 - 05-17-2011 Thanks Seacrest. I haven't seen such a beautiful job of obfuscation in ages. Without the jargon, what I want to end up with is a set of folders with names consisting of the business name & zip. There are several spreadsheets with hundreds of lines in each. Re: Generate folders from spreadsheet? - tenders - 05-17-2011 He DID answer the question, more or less, and he DID offer that it might not be your kind of answer. Re: Generate folders from spreadsheet? - modelamac - 05-17-2011 Seacrest, that is a classic. If I didn't know better, I'd think you were a lawyer/politician. :wink: Re: Generate folders from spreadsheet? - Dik2 - 05-17-2011 I'm not complaining, and I do appreciate the sophistry. So it can be done. Now can someone translate the Geek Greek to Mac Speak for this old fart? Re: Generate folders from spreadsheet? - Seacrest - 05-17-2011 So a fairly straightforward -- albeit geeky -- answer is now sophistry? Humph. Re: Generate folders from spreadsheet? - Paul F. - 05-17-2011 I thought it was a very elegant solution... In fact, I'm squirreling it away for future reference, in case I ever need to do something simillar. ( I used to be something of a shell-skeptic... now I'm starting to see lots of applications where it's not only nice, it's freaking magic compared to using the GUI... ). Re: Generate folders from spreadsheet? - Dik2 - 05-18-2011 Thanks Paul for confirming that it can be done. Now what do I have to do to get someone to talk me through it in understandable language? Re: Generate folders from spreadsheet? - Dik2 - 05-19-2011 Allright, I found a kind young geek who speaks English. Here's his solution: Hi Dik- So here's what I found.... 1. Create a .csv file from your spreadsheet with two columns. (One column with the name and the other with the zipcode.) Name it folders.csv. 2. Create a folder and name it whatever you'd like and place folder.csv into that folder. 3. Open Terminal from Applications 4. type cd followed by a space into terminal like this 'cd ' 5. Drag the folder you created that has the folder.csv file to terminal. This will add the folder path after cd. Hit return. 6. Terminal should now show the folder name 7. copy and paste this cat folder.csv | xargs mkdir into terminal and hit return. That's it. You should see the folder populate with lots of folders using this 'name,zipcode' convention. Feel free to give me a call if you have any questions. Austin. |