Professional Web Applications Themes

Files from Folders? - Mac Applications & Software

"Bennifer Lofleck" <hirt.com> wrote in message news:2ba2b0ef356121b6c322d212e23dacb3free.teranew s.com... > Is there an app or utility that will extract files from multiple > folders and put 'em where designated? > > I've got 300 folders with various files and I want to transfer those > files from the 300 folders into one folder. It doesn't matter if > they're copies because I'll trash the original 300 folders. Are all those folders accessible from a single folder? And is nothing else within that folder except the three hundred other folders? In other words: Top Folder 1 File 1 File 2 Folder 2 ...

  1. #1

    Default Re: Files from Folders?


    "Bennifer Lofleck" <hirt.com> wrote in message
    news:2ba2b0ef356121b6c322d212e23dacb3free.teranew s.com...
    > Is there an app or utility that will extract files from multiple
    > folders and put 'em where designated?
    >
    > I've got 300 folders with various files and I want to transfer those
    > files from the 300 folders into one folder. It doesn't matter if
    > they're copies because I'll trash the original 300 folders.

    Are all those folders accessible from a single folder? And is nothing else
    within that folder except the three hundred other folders?
    In other words:

    Top
    Folder 1
    File 1
    File 2
    Folder 2
    File 3
    File 4

    etc.?


    If so, this can be done from the terminal. Run up the terminal, cd to the
    correct folder (Top, in the example above), then:

    find . -type f -exec mv {} <full_path_to_target_folder>

    Translation: starting from the current directory, find everything that is of
    type 'file' and move whatever you found to the new folder. -type f enforces
    the 'file' bit (so your directories aren't moved), and the {} token stands
    for 'whatever you found'.


    Cheers,
    Ian




    Ian McCall Guest

  2. #2

    Default Re: Files from Folders?

    Ian McCall <ianeruvia.org> wrote:
    > Are all those folders accessible from a single folder? And is nothing else
    > within that folder except the three hundred other folders?
    > In other words:
    >
    > Top
    > Folder 1
    > File 1
    > File 2
    > Folder 2
    > File 3
    > File 4
    I had a look and many folders have 1-3 folders within _them_. Looks
    like this-

    Top
    Folder 1a
    File 1
    File 2
    Folder 1b
    File 1
    Folder 2
    File 3
    File 4

    But yeah, _all_ those folders live in a single folder (Top) like you
    illustrate

    How would that alter the grep command? (What you showed me _is_ called
    a grep command, right?)
    Bennifer Lofleck Guest

  3. #3

    Default Re: Files from Folders?


    "Bennifer Lofleck" <hirt.com> wrote in message
    news:010720031044463421%hirt.com...
    > I had a look and many folders have 1-3 folders within _them_. Looks
    > like this-
    >
    > Top
    > Folder 1a
    > File 1
    > File 2
    > Folder 1b
    > File 1
    > Folder 2
    > File 3
    > File 4
    >
    > But yeah, _all_ those folders live in a single folder (Top) like you
    > illustrate
    That's fine - the command will work for however many sub-folders there are.
    Had a thought - if you're worried about automatically moving files before
    checking the result, you could always make copies instead to confirm things
    were right.

    So to make copies...
    cd <Top>
    find . -type f -exec cp {} <full_path_to_target>

    To just move 'em...
    cd <Top>
    find . -type f -exec mv {} <full_path_to_target>

    > How would that alter the grep command? (What you showed me _is_ called
    > a grep command, right?)
    Just a find command. Grep is for searching for text within something.


    Can't tell I'm a recent convert because of the Unix underpinnings, can
    you...? :-)


    Cheers,
    Ian


    Ian McCall Guest

  4. #4

    Default Re: Files from Folders?

    Ian McCall <ianeruvia.org> wrote:
    > Can't tell I'm a recent convert because of the Unix underpinnings, can
    > you...? :-)
    LOL. I'm trying to learn some Unix too but my brain just isn't modded
    for terminal mode. ;-)

    I'll let ya know how it turns out!!
    Bennifer Lofleck Guest

  5. #5

    Default Re: Files from Folders?

    Ian, if you're out there!!


    [KLAX2:/Volumes/Smith/Z1] dh% find . -type f -exec mv {}
    /KLAX2/Volumes/Smith/Z2/
    ..: -exec: no terminating ";"

    [KLAX2:/Volumes/Smith/Z1] dh% find . -type f -exec mv {}
    /KLAX2/Volumes/Smith/Z2
    ..: -exec: no terminating ";"

    I get into my test "top" folder, execute the command, and am told I
    have no terminating semicolon. (Don't mind the breaks you see here,
    everything's on one line in terminal.
    Bennifer Lofleck Guest

  6. #6

    Default Re: Files from Folders?


    "Bennifer Lofleck" <hirt.com> wrote in message
    news:010720031848053564%hirt.com...
    > Ian, if you're out there!!
    >
    >
    > [KLAX2:/Volumes/Smith/Z1] dh% find . -type f -exec mv {}
    > /KLAX2/Volumes/Smith/Z2/
    > .: -exec: no terminating ";"
    >
    > [KLAX2:/Volumes/Smith/Z1] dh% find . -type f -exec mv {}
    > /KLAX2/Volumes/Smith/Z2
    > .: -exec: no terminating ";"
    >
    > I get into my test "top" folder, execute the command, and am told I
    > have no terminating semicolon. (Don't mind the breaks you see here,
    > everything's on one line in terminal.

    ok then - use :

    cd <top>
    find . -type -f -exec mv {} <target_folder> \;

    The terminating semi-colon tells find where the end of the command it must
    execute is (the -exec bit). The backslash is to make sure the semi-colon
    goes into the find command unchanged - probably overkill, but some Unix
    shells can do unexpected things with control charaters.



    Cheers,
    Ian


    Ian McCall Guest

Similar Threads

  1. Accessing files/folders inside other application folders
    By jeffreyabe in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: March 19th, 01:57 AM
  2. Deleting folders/files
    By pezmorized in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: May 22nd, 10:39 PM
  3. Templates & Folders & Files
    By ironcate in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: May 22nd, 10:37 AM
  4. Making folders and sub-folders and files NOT read-only
    By Joe Cocovich in forum Windows XP/2000/ME
    Replies: 3
    Last Post: July 3rd, 01:03 PM
  5. Files to Folders
    By johnny bobby bee in forum Mac Applications & Software
    Replies: 1
    Last Post: June 24th, 12:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139