Export Folder contents to .txt or .xls????

Before I get going on my question forgive me if I posted this in the wrong area. I had know clue which one to use that wouyld get the most exposure.

Is there away to get the contents of a folder exported to a text document or Excel? A copy paste function?
I am hoping for an easy way to update my movie list w/o having to retype it all the time.

Thanks for the help! 🙂

24" of Glory iMac, 12" Powerbook x2, iBook, iPhone, Apple TV, Mac OS X (10.4.8)

Posted on Oct 14, 2007 5:26 PM

Reply
3 replies

Oct 14, 2007 5:50 PM in response to KamikazeKunze

Open the Terminal in Applications -> Utilities.

type at the prompt

ls -l (path) > myfile.txt


where path is the path to the folder. Note by default Terminal dumps you in your Home folder. So if your movies are in your Movies folder just enter Movies in place of (path). If they are in a subfolder of movies, enter that subfolder's name in the path like

Movies/subfolder


Note the Desktop folder is a subfolder of your home folder so you can enter Desktop for any movies stored in your Desktop folder.

You can also drag the folder into the Terminal window when you are ready to enter the (path), making sure to space the > one space after the path, and the ls -l one space before the (path).

Note when I say (path), the parenthesis never show themselves in the path. That's just there so you know I mean it is a changeable based on which folder you stored it in.

Message was edited by: a brody

Oct 14, 2007 5:49 PM in response to KamikazeKunze

Open the Terminal application in the /Applications/Utilities/ folder and type in the following:

ls -R

followed by a space; the l in the command is a lowercase L. Next, drag the folders into the Terminal window and press Enter. This command will give you a text list of everything in the folder; you can then copy and paste the list into a text editor. Some reformatting of the text may be necessary.

The Terminal output can be directed to a file by appending text such as:

~/Desktop/content.txt

to the end of the command prior to running it, before the ~, put one or two instances of > followed by a space. Using two > symbols will append an existing file, while using one will overwrite it. The completed command can be put into the Script Editor in the /Applications/AppleScript folder using the following:

do shell script "command"

and saved as an application for easy access.

(24972)

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.

Export Folder contents to .txt or .xls????

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