Finding and moving files

I have an external hard drive that has many folders. Within the folders are scattered movie files. I am looking for a script or a hint that would allow me to to search the external hard drive, locate the files and then copy them to a single folder.
thanks

I think that it would be easiest done through the Find function in Finder or spotlight. As an alternative you could use the find command in terminal. Something like this should do the trick:
find /where/to/search ( -name *.avi -or -name *.mpg ) -exec mv {} /path/to/new/location/ ;
An AppleScript might be too much work for this job. One can of course wrap the above command with some AppleScript and obtain the location where to start the search and the target folder interactively but I personally would still use the above command for the actual searching and moving.
Message was edited by: hungryjoe

Similar Messages

  • Finding and moving files in multiple folders

    Hi
    I am trying to locate and move hundreds of .wav files currently situated in 193 subfolders inside a folder called "ambient". They are mixed with other filetypes. I want to move all these wav files into a new folder called "new ambient" but without any subfolders.
    At the moment the only way I can think of doing it is to open each subfolder and move each wav file to the new folder. An earlier task took me hours! Is there anyway in spotlight or finder or any other app I can filter the wav files from inside the ambient folder's subfolders (ignoring the subfolders themselves and other filetypes)  and "apple shift" bulk move them in one go to the new ambient folder? A  simple wav search in finder, which I've tried,  would also catch thousands of other wav files elsewhere on the hard drive, but I can't find a way to search within a specific folder
    any help appreciated

    You could use a smart folder in Finder.
    Open  a Finder window and go to the top level folder where the files are.
    Press command -f a Finder search box opens.
    What you'll see after the cmd-f the Search: folder should reflect the folder you opened and will search.
    Now click the Kind box and in the list that opens select other
    In the attribute window that opens search for extension
    Choose File extension and click OK.
    Back in the Finder window enter wav
    All the files under this folder with an extension of wav will appear in the Finder. You could leave the files where they are save this search and always access the wav files from here. It will appear and act as a normal folder. The advantage is that the update of the search is dynamic. If you add more wav files in the future they will show up here automatically.
    If you want to create an actual folder to hold these then open a new Finder window and create the new folder. Then select all the files in ths window and drag them to the other.
    reagrds

  • My external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive. Same thing has happened with Final Cut Express.

    My new LaCie external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive.
    The same thing happened recently between Final Cut Express and my other LaCie external hard drive used as the Scratch disk. It fixed itself.
    I've run out of ideas. Help would be very much appreciated. Thanks.

    have you done some searches on FCPx and time machine? Is there a known issue with using a TM drive with FCPx? dunno but ...wait...I'll take 60 sec for you cause I'm just that kind of guy....   google...." fcpx time machine problem"  Frist page link 
    http://www.premiumbeat.com/blog/fcpx-bug-best-practices-for-using-external-hard- drives-and-final-cut-pro-x/
           You cannot have time machine backups on your hard drive if you intend to use it in FCPX.
    booya!

  • I can't seem to open (view) my photos.  I get an error message that says "the file couldn't be opened because you don't have permission to view it. To view or change permission, select the item in the finder and choose File. Get info."

    I can't seem to open (view) my photos.  I get an error message that says "the file couldn't be opened because you don't have permission to view it. To view or change permission, select the item in the finder and choose File. Get info."  I have never had this happen before?  Thanks!

    Try the following:
    1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
    2 - Run Option #1, Repair Permissions.
    OT

  • I recently had a kernel panic in which I think my hard drive only had so much space left after I ran a bunch of drivers I thought I needed. I uninstalled all and moved files. For some odd reason I'm not getting sound of of my hdtv/monitor.HELP?

    I recently had a kernel panic in which I think my hard drive only had so much space left after I ran a bunch of drivers I thought I needed. I uninstalled all and moved files. For some odd reason I'm not getting sound of of my hdtv/monitor.HELP? I uninstalled all the drives and apps I download. I moived files either to trash if not needed, and others to other external drives. I went into disk utility and did a repair disk permission and verify disk. Clean out junk files. Now my hdtv/monitor does not give me any sound, nor does my mac mini. Can someone please tell me what to do?

    What drivers?

  • Cannot reinstate catalog after returning PC (Windows 7) to factory settings (because of worm infection). Catalog was backed up on external drive but not using PSE backup facility. Cannot find and *.tly file. Is this hopeless?

    Cannot reinstate catalog after returning PC (Windows 7) to factory settings (because of worm infection). Catalog was backed up on external drive but not using PSE backup facility. Cannot find and *.tly file. Is this hopeless?

    If you made backups of all of your photos and your catalog file using some third-party method (i.e. not using the PSE catalog backup command), then you should be able to restore everything.
    Step 1. Put the photos in the EXACT SAME LOCATION as before. For example, if they were in subfolders of C:\Users\<username>\Documents, then they must go into the exact same subfolders of C:\Users\<username>\Documents.
    Step 2. Move the catalog file to wherever you want it to be, and then double-click on it.

  • I can not open documents I get a message that says To view or change permissions, select the item in the Finder and choose File Get Info.  help

    I have a mac with os X.  I have saved documents and photos on my computer and am now not able to open them.  I get a message that tells To view or change permissions, select the item in the Finder and choose File > Get Info.  I do that and it is not locked.  confused.  help

    In the Info window it's this:
    Do you have read and write privileges?

  • Aborting index build. Too many errors with finding and copying files ...

    Hi dears,
    I'm using UCM 11g.
    I'm trying to start the automatic update cycle. When i start it, it gives me an error message just like :
    Indexing aborted at :<time>. Aborting index build. Too many errors with finding and copying files to the appropriate place.+
    Can anybody help me about this problem?
    Helps will be appreciated.
    Erdo
    Edited by: erdo on 28.Mar.2013 11:11

    Read this: error in Collection Rebuild Cycle
    and maybe also UCM Indexer - Collection Rebuild Cycle errorring out

  • Find and copy files by file name

    Hey Gang,
    I sure hope you guys can help me out. I'm looking for a piece of software that can read a txt file or spreadsheet to find specific files and copy them from one place to another.
    In other words, I have a folder with 1000 files in numerical order from 1 to 1000. I need software that can copy only selected images (ie 4, 53, 244, 456, 999, etc...) to a separate folder.
    Any Ideas?
    -Chris

    This is very simple to do with a script.
    Let's assume that the files are in /Users/cnhoward/source and you want to move particular files to /Users/cnhoward/dest. Let's say you have a text file, numbers.txt, with one number on each line, and the files are named like 'file_X.txt' where 'X' is the number. Then you could do this in terminal:
    for n in `cat numbers.txt`
    do
    cp /Users/cnhoward/source/file_${n}.txt /Users/cnhoward/dest
    done
    You don't give much in the way of details, but that should give you an idea to start from.

  • PLEASE PLEASE HELP! finding and locating files..

    Hellooo!..
    First of all, I'd like to start by saying that i am a DJ and music producer using Logic Pro 9.
    ..I have just spend the last 5 days organising my whole iTunes, adding albums, renaming, adding artwork and pritty much making sure that everything is bob on and perfect!
    So last night i was nearly done and had pretty much completed the organising of my itunes; everything looks cool everything is labelled correctly etc..
    This morning, being the absolute TOOL that i am! i (without realising at first) deleted every song in the iTunes Media folder, which i didn't realise was the default file directory for all my music. (i still have all my music files around the laptop they are not deleted, what has deleted are just the copys of the songs that itunes automatically makes and places into the 'Media' folder) Dont even ask how and why i did this or what was going through my mind! just one of those moments i suppose! So still i deepened my problem by emptying the Trash bin so everything had gone.
    So.. obviously as you would presume, the dreaded ''!'' appears when i try to play a song and says that it could not find the original file and would i like to locate it? ..after emptying the recycle bin i downloaded some software that restores what you have deleted but this was no use as certain files were missing or corrupt etc so that idea was scrapped.
    All of the music in my library IS on my macbook located in various folders a lot are in 'downloads' folder and alot are in another folder named 'Albums from old computer'
    So all of my music is on my laptop but i really dont want to have to go through 2689 songs individually to locate them.
    when i tried locating one, i found the file and this song was allowed to be played etc but it also popped up with 'Would you like iTunes to use the location of 'song name whatever' to find other missing files in your library?' ..amazed that it came up with this i clicked yes,but no files were found still :S even though many of the files are in the same folder as this song ive just located.. so this option seems to make no sense?
    Basically im looking for a way for iTunes to either search the whole laptop for where the song is located or anything else that would allow them to be found and played. The reason i need this to happen is because the whole library is amazingly organised now it all still looks perfect but would also sound perfect too if i could play the effing songs!
    I dont know if ive explained this clearley enough or what but i would really really appreciate it if someone could get back to me on this! This is 5 days work gone down the drain!
    Thanks,x

    Hi, FlyBeatz.
    In your iTunes music folder, is there still a file called iTunes Library which has the word "Lib" under the iTunes logo? Normally iTunes has an "iTunes folder" which contains the above and "iTunes library Extras.itbd, iTunes Library Genius [all with lib under the itunes logo] and iTunes Library.xml.
    iTunes lib contains the metadata, the info that says album, artist, tracks name. the music folder just has track1, 2 etc and the track name. You need the Lib file to make iTunes display the tracks properly. If this is lost or deleted then its the hard slog.
    There is also a folder called iTunes music which contains the audio tracks filed under artist, then album[s].
    If the iTunes Lib file is intact then you might be able to import all the music files back into the one folder and have iTunes recognise them as before the great delete. Make sure its the same name, and file structure or 'tunes will get confused. It also puts a lot of stuff into the various artists or compilations folders when it shouldn't, so watch that if you get discrepancies.
    You'll need to create a separate folder for each artist, then inside that, create a folder for each album [or track] and copy the audio files into the appropriate location. Then open iTunes and see if it recognises the library correctly.
    Warning. If this doesn't work - and iTunes is not a great piece of software for this kind of repair- it could make things worse.
    Another option. Do you have time machine enabled? If so, simply reset the computer to a time [say 2 days ago] just before you did the delete. If TM is running automatically, it usually backs up every 30-60 minutes automatically.
    I'd also suggest running time machine before attempting my first suggestion in case that solution makes things worse, then you simply restore the machine to its current [somewhat scrambled] state.
    Third option is to ring apple tech support and ask for an iTunes expert to help you.
    Which you may have already done.
    If none or these - or someone else's - solutions don't fix the problem then its the long hard slog.
    I've had to do it with over 120G and 200G of wavs more than once thanks to iTunes stupid behaviour, so I know where your at.
    Good luck with it fellow Logic Pro user.
    Scorpii.

  • RW2 preview in finder and "Open file" dialog

    Hello,
    I run into a curiosity with RW2 file format (from LX3 and FZ38). In Finder, RW2 preview is not displayed and only default icon (black icon with text exec in corner). The same RW2 files does have correct preview, when I browse them in "Open file" dialog window (for example Safari > File > Open File...).
    How it is possible the Finder and Open dialog do have different settings? Is it possible to copy these settings?
    Thank You

    see thread http://discussions.apple.com/thread.jspa?messageID=3805971&#3805971
    though no solution yet.

  • Find and remove files

    Hi,
    I was given a task to do some housekeeping of users directory
    Basically, the structure is of below.
    /User DIR
    ---UserA
    ---UserB
    ---UserC
    ---UserD
    ---UserE
    Each user contain several type of files.
    I wan to do a housekeep of the directories to remove *.txt, *.log, *.wk1 that are more than 5 days old.
    Pls kindly assist.
    i need to search for several type of extension .wk1 , .log , .txt etc. how do i incorporate it in? . Another thing is
    ls -l | find . -name "*.txt" -mtime +3 -exec ls {} \; it actually returns me all the subdirectories as well. y is that so?
    in my office, i have existing scripts that have similiar syntax
    find . ! -type d -ctime -5 -name '*.txt' -exec ls {} \;
    find . ! -type d -ctime -5 -name '*.txt' -exec rm -f {} \;
    what does find . ! -type d means?
    Pls kindly assist.

    cghcgh wrote:
    echo "\n Foldername = ${DIRNAME}"
    cd ${DIRNAME}
    USERFILE=`ls -1 *.xls *.wk1 *.txt`
    for USERFILENAME in ${USERFILE}; do
    echo "\n Checking whether file is more than 7 days"
    echo " Filename = ${USERFILENAME}"
    echo " Removing this file = `find . -mtime +${KEEP} -a -name ${USERFILENAME} -exec ls -l {} \;`"
    find . -mtime +${KEEP} -a -name ${USERFILENAME} -exec rm
    UGH You are looking for files with an ls, then going back and running two separate finds for every file. But every find will do a full descent/search run of all data in that directory. That's horribly inefficient. The more data under that directory and the more files the 'ls' hands off, the more time and IO it will consume.
    Why not just replace that section above with:
    echo "\n Foldername = ${DIRNAME}"
    find ${DIRNAME} ! -type d \(-name "*.xls" -o -name "*.wk1" -o -name "*.txt" \) -mtime +${KEEP} -exec rm {} +
    One find, no 'ls', no problems with spaces.
    Add in a '-print' before the '-exec' if you want to print or capture the filenames as you're removing them.
    Darren

  • Vat code change, EDI file number finding and EDI file structure chage?

    Hello Gurus
    Our client has a plant in Europe, which has a largest supplier. We process electronic invoices to the vendor through a provider OB10 ( private company - invoicing provider ).
    In the transfer of the electronic data to the invoice posting, a VAT code is added to the details, that appears to be pulling from a certain Table in the system.
    I want to know from which tables this field has pulled up to the Invoice?
    In continuation of the process ...I have come across an issue on EDI file structure change. I have provided with the the Idoc numbers of above invoices, from the idoc numbers i need to find out the EDI file number. But when i went to WE02, WE05 with those idoc numbers i couldn't find the EDI file number( Interchange file number ref).
    How can i find the EDI file number and i have to suggest the EDI team for changing the file structure in regard to the VAT code updating according to the Plants abroad function.
    What are the things i need to suggest them exactly in regard to this?
    Please reply me ASAP...
    Thanks
    Mallik

    The table for tax code is T076M - maintainable using T code OBCD.  For EDI file number, execute T Code WE02 - enter IDoc number and execute (F8). In the right window pane, choose select layout -> change layout and pick up the field Interchange file reference. Guess this is what you are looking for.
    OR
    Go to transaction WE02 or WE05 enter Idoc number and choose execute. When Idoc data is displayed double click on Control Record in left pane. Choose Details tab. Interchangable file under References.
    You can also refer the entries in table EDIDC.
    Reference to interchange file:
    This field contains the reference number of the interchange file in which the EDI message was transmitted.

  • Finding and showing file date/time i'm referencing on

    How can I find and show on page the date and time parameters of file on which i'm referencing with using an JSP? I tried it with java.io.*,
    <%@ page import="java.io.*"%>
    <%@ page import="java.awt.*,javax.swing.text.*"%>
    <%@ page contentType="text/html; charset=windows-1250"%>
    <%
    File u_file=new File("http://oracle1/pn/index.html");
    long dat=u_file.lastModified();
    Date u_date=new Date(dat);
    %>
    <%=u_file.getPath()%>
    <%=u_file.getName()%>
    <%=u_file.isFile()%>
    <%=u_date%>
    but the date was always 0(1.1.1970) ,result of isFile was null, but result of Pathname and Name was correct.
    What is wrong?

    From the JSP, if you say, File file = new File(path);
    It will try to search for the file starting from the bin directory (I am using tomcat). So, you need to give the full path to the file from there.
    For example, if your file is in, webapps/examples/html/ directory, you need to use something like this,
    File file = new File("../webapps/examples/html/index.html");
    You can't give URL as the file name/path. You can't access Oracle's file system!!!
    Hope this helps.
    Sudha

  • Finding and Renaming Files

    I am trying to fix a bunch of file names by adding the appropriate extension based on file type.
    I had downloaded a bunch of images from my webserver and noticed the '.jpg' or '.gif' got cut off because the file names were too long.
    So, I want to locate all Files of Type 'JPEG', for example, then filter by those whose name or name extension are missing the '.jpg' on the end, and simply add that to the file name.
    The problem is Automator can't seem filter these files and perform the desired action on them. Every time, and every which way I've tried, it finds ALL the files, with and without the .jpg at the end.
    I have:
    Filter files by File Type is JPEG Image File
    Name Does not contain '.jpg'
    (I've tried Name Extension does not contain 'jpg' too - same result)
    Any suggestions?

    Renaming a file to add an extension is fine, if you know what the file type is to begin with. Since the file was downloaded from a web server, there may not be any Finder info or other metadata to determine what the type is, so you would need to look at the file data and make a guess. There is a built-in shell script that tries to determine a file's type, and some of the more common types (such as text, jpeg, and gif) are checked for. The following Run AppleScript action uses that to try to guess what the file type is and filters accordingly:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters} -- find file types
    try to determine file types using the 'file' shell script and filter accordingly
    input: a list of Finder items (aliases) to filter
    output: a list of Finder items (aliases) filtered
    set output to {}
    set FileType to (choose from list {"JPEG", "GIF", "PDF", "RTF"} with title "Filetype Filter" with prompt "Select a type to filter:")
    if the result is false then error number -128
    repeat with AnItem in the input -- step through each item in the input
    tell application "Finder"
    if (name extension of AnItem) is "" then
    do shell script "file -b " & quoted form of POSIX path of (AnItem as text)
    if the result contains FileType then set the end of the output to (AnItem as alias)
    end if
    end tell
    end repeat
    return the output -- pass the result(s) to the next action
    end run
    </pre>
    Tested workflow:
    1) Ask for Finder Items (Type: folders)
    2) Get Folder Contents
    3) Run AppleScript (the above script) -- choose JPEG or whatever the file type is
    4) View Results
    5) Rename FInder Items (Add Text - Add: .jpg after name) -- or whatever the extension should be
    HTH

Maybe you are looking for

  • Correct sequence settings

    Hi, I'm working on a video to be posted on internet, in a "webtv" that uses videos with the format of 396 x 270. I filmed in a HD camara, 1920 x 1080. I'm setting the sequence to 792 x 540 (twice the size of the webtv screen just because if later I d

  • Airplay not stable (stutters)

    I get radio and Spotify via Airplay not stable running. I have Time Capsule with Serial: C86H21DWDM74 and 7.6.4 software and an Airport Express to Serial: C86LG8WGDV2R and software version 7.6.4 and a Fritzbox 7340 modem / router. The following setup

  • How to play Netflix on my Imac G5, it has Safari and Firefox 3, and over 1gb Ram and Mac OS X 10.4.11

    How to play Netflix on my Imac G5, it has Safari and Firefox 3, and over 1gb Ram and Mac OS X 10.4.11

  • Difference between Lightroom 5 and 5.7

    What is the difference between Lightroom 5 and 5.7? In 5 I can see the words "Pictures " and "Lightroom Pictures" on my screen but on my laptop (5.7) it shows the pictures are in there, but doesn't show the label "Lightroom Pictures" Should I be conc

  • Captivate 5 projects flickers.

    Good day all! I publish my Captivate 5 projects using the Media option. These projects run smoothly on different operating systems, including XP and Win 7. Today I tried to run it on another Win 7 machine. The following suddenly started happening: th