Copying file names

Posted:
in macOS edited January 2014
Is there an easy way to copy a list of file names (only) and paste the list of names into TextEdit, Excel, or ???

Comments

  • Reply 1 of 11
    mr. memr. me Posts: 3,221member
    Use the Terminal:
    1. Type ls {path of file directory}.

    2. Copy list of files in Terminal window.

    3. Paste into text editor.

  • Reply 2 of 11
    MarvinMarvin Posts: 15,322moderator
    You can also drag the files straight into TextEdit and do a find/replace to get rid of the path or alt-drag the list and it will do a vertical selection of the paths, which should be the same length and you can delete that part leaving just the names.
  • Reply 3 of 11
    Select the file list in the finder, copy (Command-C) and paste (Command-P) into a TextEdit document. Ready.
  • Reply 4 of 11
    sequitursequitur Posts: 1,910member
    Quote:
    Originally Posted by Marvin View Post


    You can also drag the files straight into TextEdit and do a find/replace to get rid of the path or alt-drag the list and it will do a vertical selection of the paths, which should be the same length and you can delete that part leaving just the names.



    Either way, I get a horizontal row of icons but no file names.
  • Reply 5 of 11
    sequitursequitur Posts: 1,910member
    Quote:
    Originally Posted by Achim View Post


    Select the file list in the finder, copy (Command-C) and paste (Command-P) into a TextEdit document. Ready.



    Command P is for Print. If I use Command V, again, all I get is a horizontal row of icons and no file names.



    I must be doing something wrong, but I don't know what. I have Snow Leopard. Is that supposed to work in SL?
  • Reply 6 of 11
    bsenkabsenka Posts: 799member
    Quote:
    Originally Posted by Achim View Post


    Select the file list in the finder, copy (Command-C) and paste (Command-P) into a TextEdit document. Ready.



    That pastes that actual files into the text document, so you now have an unformatted newsletter of sorts containing every page and/or image of every document.



    Not what I'd call a manageable list.
  • Reply 7 of 11
    Quote:
    Originally Posted by bsenka View Post


    That pastes that actual files into the text document, so you now have an unformatted newsletter of sorts containing every page and/or image of every document.



    Not what I'd call a manageable list.



    In TextEdit, after you pasted the file list, in the menu bar goto Format > Make plain text... Tada!



    And yes, Command-P should of course be Command-V. My mistake, sorry. And yes, it works in SL.
  • Reply 8 of 11
    sequitursequitur Posts: 1,910member
    Quote:
    Originally Posted by Achim View Post


    In TextEdit, after you pasted the file list, in the menu bar goto Format > Make plain text... Tada!



    And yes, Command-P should of course be Command-V. My mistake, sorry. And yes, it works in SL.



    You da man~!!!! Thanks. Changing the text makes it happen. Now why didn't I think of that?
  • Reply 9 of 11
    bsenkabsenka Posts: 799member
    Quote:
    Originally Posted by sequitur View Post


    You da man~!!!! Thanks. Changing the text makes it happen. Now why didn't I think of that?



    Nice!...also, if you change to text before pasting, it only pastes the list!
  • Reply 10 of 11
    sequitursequitur Posts: 1,910member
    Quote:
    Originally Posted by hilfiger View Post


    You double click on the file but press once and after 2 second the other and copy the name and paste where ever you wanted.



    That is not clear. Where do you double click on the file? The Name of the file? What do you press once? and what is the 'other' that you click after 2 seconds? What name do you copy and paste - the name of the file?



    I have tried to do as you've suggested, but no joy.
  • Reply 11 of 11
    gongon Posts: 2,437member
    Quote:
    Originally Posted by Mr. Me View Post


    Use the Terminal:
    1. Type ls {path of file directory}.

    2. Copy list of files in Terminal window.

    3. Paste into text editor.




    Waste of time. Put the info directly where you want it.



    ls > files.txt

    (optional) open files.txt
Sign In or Register to comment.