CFDirectory and renaming files

I need to rename all the files in a folder. Do I use
cfdirectory to list the files and then use cffile to rename them?
If so how would I go about and do this?
Anthony

Yup.
<cfdirectory action="list" name="filesToChange" ...>
<cfloop query="filesToChange">
<cfile
action="rename"
source="#filesToChange.directory#\#filesToChange.name#"
destination="New.path.and.file.name">
</cfloop>
Or something close to that.

Similar Messages

  • Open File dialog user can delete and rename files.

    Does any one know if there is a way to prevent a user from deleting and renaming files by right clicking on them in an Open File dialog box?

    Well, the problem is that this isn't a LV dialog box. It's the standard Windows file dialog box and this is the way they work in Windows.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Automator script search document for file name, and rename file to date

    Hi all,
    I'm having a hard time with Automator... and I can't figure out how it's done!
    Searched the web for it a couple of times, spend hours with Automator already, but I guess my need is random!
    The thing is:
    I got a folder with 1066 files, all the files has random names.....
    I got a document (now it's html, but can convert it to PDF or txt or so ever....) with the coressponding random file names in the html.... some words before that there is the date the photo was taken in this format: 08/25/11
    Now I want somehow make automator search that folder each filename... match it in the document with the filename, and rename the files in the folder to the date the photo's were taken.... and that for all 1066 files.....
    anybody a great idea? Some help? I'm a real newby at Automator scrips!
    thanks

    Have you considered A Better Finder Rename 9?
    A Better Finder Rename 9: The Batch File Renamer for Mac OS X
    Otherwise, what you propose seems to be rather like carving the Pieta using a plastic butter knife. But, if you want, here's one example of a rough algorithm to start ...
    * translate the HTML to ASCII text in this format:  filename (date)
    * read one line at a time from the ASCII file
    * for each line, search the folder for the file
    * rename the file according to the (date)
    BTW, you might avoid a strict renaming according to just the date.
    Best luck with this project.
    JJW

  • Moving and renaming files after PSE has uploaded them

    I use PSE 7
    I have many folders  (50+) and perhsps file names  ( few thousdand)  that after uplaoding all of them into PSE and tagging about half I am consdering remaning some of them and also combine some folders or just renaming some folders
    any  way to do this with in PSE by jsut doing a folder at a time ( change folder name)  and change file names all at once.
    Would it be easyer to start all over by deleting all images in PSE but not on the disk then reload it all, will the tags still  show up on the photo AND all the tags icons on the side bar be their after
    any help greatly appreacted, I should have done this before starting to work in PSE
    thanks
    Mike

    I think the biggest thing people miss understand about the Organizer  is you no longer have to be concerned with folders or where the photos are located. The beauty of Tags allows you to locate your photo by various methods that you can not do with folders. You can have a tags for location, event and peoples name on the same photo and  you can locate it in your Organizer catalog by selecting any combination of the tags you have assigned. You can not do that with folders. As an example you can find a photo of Jane, from California, at your graduation party.
    Adobe does a poor job of highlighting the advantages of creating tags. The original creator of Album that was later changed to Organizer, Michael Slater, wrote a book on how and what you should think about before creating tags. Unfortunately, he no longer works for Adobe and the book was written for PSE 3. And a lot has changed since then. But the basic concept of using tags verses folders is still applicable and the Chapter is and well worth the price of the book which is still available from Amazon.  http://www.amazon.com/Organize-Photos-Adobe-Photoshop-Elements/dp/0321246969

  • How do I get PSE10 to import and rename files in order?

    When I place my CF card into the reader PSE opens and displays all the photos on the card the problem is they are out of order. I take volleyball photos and use the burst often The files are numbered properly by the camera but PSE seems to get them mixed up. When I import and renamer them PSE thakes them in the order they are shown and they are then renumbered out of order causind many shots to be out of order. I have never had this problem before. I have been using PSE 6 up thru 10 now and this is the first time I have had this happen. Last season I wasusing PSE9 and all my bursts sequences are in purfect order.
    Am I missing something in the settings?

    Hi,
    The problem I have is with the PSE Organizer "Photo Downloader". When I
    plug the CF card from my camera into the card reader on the computer the
    "downloader" opens up and shows thumbnails of the files on the card. At
    this point the files are out of order based on the file numbers applied
    by the camera. I.e.: one sequence looks like this-
    11,12,16,15,14,13,17,18; where 12 thru 16 were a burst. Another
    sequence- 121,120,125,124,122,123; all one burst. As you can see they
    are out of order.  I tried leaving the card in the camera and the same
    thing happens. If I view the photos in /on the camera they are in the
    right order. What has been happening is that I rename and number the
    files as I import them. When that happens the files get numbered in
    sequence as to how they are seen in the "downloader"....this means in
    the examples shown 16 would become 13; 15 becomes 14 ect. This ends up
    mixing up any sequence of shots.
    Once I have the RAW files imported I import them to Lightroom 4 to do
    most of my processing. Here if I choose to arrange by time created I can
    get them in the right order but because the files are rearranged into
    the correct order and since I renamed them on importing the file numbers
    are now out of order. After figuring out what the problem was I can now
    import the files to lightroom without renaming > arrange by time or file
    name> rename> and all seems to be OK. My question is I never had this
    problem before and it was very nice to be able to rename the files at
    import and be done with it.
    I haven't had time to check into it but one thing I'm wondering is is
    there a way to rename the files at import without changing the file
    number? Is there a way to insert the date and text while keeping the
    IMG_Number....i.e IMG001 becomes 2012 09 15_Volleyball_0001 keeping the
    original file number and only inserting a date/name? This would solve
    the whole problem as I could then arrange by file name and all would be
    well.
    Any ideas or help would be appreciated.

  • Regarding ssis - move and rename files

    Hi,
    i have two txt files in c drive ,
    and i have to move two files in d drive at a time and should rename that files

    for some exmaples you can check this : http://www.rafael-salas.com/2007/03/ssis-file-system-task-move-and-rename.html
    regards
    joon

  • Move and Rename file

    I am trying to move and rename all the files with extension csv in the folder. 
    c:\folder\a.csv c:\Newfolder\a20141151011.csv  datetime append after moving
    c:\folder\b.csv c:\Newfolder\b20141151011.csv 
    I cannot use ssis it has to be done in TSQL 
    DECLARE @FILELOCATION VARCHAR(250)
    DECLARE @FINALLOCATION VARCHAR(250)
    DECLARE @FILENAME VARCHAR (250) = '*.CSV'
    DECLARE @DESTINATIONFILENAME VARCHAR (250) --= @filename + '.txt'
    SET @FILELOCATION = 'C:\folder\'
    SET @FINALLOCATION = 'C:\Newfolder\' 
    DECLARE @C VARCHAR (2000)
    SET @C = 'MOVE ' + @FILELOCATION + @FILENAME  +' ' + @FINALLOCATION + @DESTINATIONFILENAME 
    exec master.dbo.xp_cmdshell @C

    the below code works fine for moving a file. For moving all files with their respective names you could try going in for a loop and achieving the same file by file.
    DECLARE @FILELOCATION VARCHAR(250)
    DECLARE @FINALLOCATION VARCHAR(250)
    DECLARE @FILENAME VARCHAR (250) = 'multilingual_sample.TXT'
    DECLARE @DESTINATIONFILENAME VARCHAR (250) = @filename --+ '.txt'
    SET @FILELOCATION = 'D:\'
    SET @FINALLOCATION = 'D:\Newfolder\'
    DECLARE @C VARCHAR (2000)
    SET @C = 'MOVE ' + @FILELOCATION + @FILENAME +' ' + @FINALLOCATION + @DESTINATIONFILENAME
    PRINT ISNULL(@C,'---')
    exec xp_cmdshell @c
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Organising, editing and renaming files in Lightroom 5

    Hi !
    I am a new Lightroom 5 user. I recently tried to organise my old photos (which stored in folders on a windows desktop) through Lightroom 5 in separate external HDDs.
    What I did was to create a master photo folder in each HDD and then add the subfolders from my desktop. I want to now edit the photos in the Develop Module , rename and save the files in the same location in the subfolders on the external HDDs. But when I try doing that, Lightroom asks me to import. Did I not already import them ?
    How can I edit,rename and save the photos ? Please help
    Thanks !
    Jeet1966

    How can I edit,rename and save the photos ? Please help
    In the Library Module, you select a photo that has already been imported, and click on "Develop", or press D. This allows you to edit your photos.
    There is no need to rename or save (in fact, there is no "Save" command) as your edits are saved automatically and are always displayed in Lightroom whenever you launch Lightroom. In general, the only time you would want a copy of the edited photo is to use it for some non_lightroom purpose, like e-mail or web or commercial printer. In that case, you could use the command File->Export... which allows you to save the edited version of your photo in whatever folder you want, and rename the exported photo as well. As I said, you don't export everything as a regular step ... its unnecessary to export everything ... you only export when you need to use the photo outside of Lightroom.

  • Shell script for moving and renaming files

    I'm not so familiar with shell scripts. I have created some simple scripts for various tasks but now I hit something I can't handle myself.
    My server receives every night a logfile from another server. This file I need to rename and move to another location. Problem is that a simple mv with new filename isn't enough, I need to insert date in filename. Format for date should be ddmmyy. Also the name of incoming file changes every night. The output always starts with same letters, let's say "log", and the date is used to identify files.
    For example I receive a file /Input/filename.log and I need to move the file to the folder /Output with name log130308.txt.
    Any tips how to insert the date as part of of filename while renaming or moving the file? I prefer shell script as I'll use launchd for scheduling the script.

    Hi again,
    so far I've constructed this:
    cd /input
    for file in `ls *log`
    do
    echo "Copying " $file
    cp $file /output/log.$file.`date +%d%m%y`
    done
    Quite there. I'm cding to directory, i'll focus later how to set some environmental parameters.
    Problem with zipping is that I don't know exact logfiles names. Each day there's a new name. So zip -q filename.zip filename.log isn't quite enough and it's impossible to use wildcards. The switch -q and checksums were welcome suggestions.
    Thanks again,
    Juha
    Message was edited by: J.Otava

  • How to ftp and rename file in Unix

    Hi Gurus,
    I've one requirement where I need to rename the file extension to .xml and read the file.
    Here I am pasting my sample code what I've tried
    #get the file from remote server
    ftp -v -n 10.60.17.111<< EOF
    user user user
    cd /u01/oratest/gebiz_processed
    lcd /usr/tmp
    bi
    get GEBIZ_ACS_RPO000*.ACK
    #mdelete $file
    #mv GEBIZ_ACS_RPO000*.* /u01/appltest
    #get GEBIZ_SUPP.xml
    bye
    EOF
    echo
    cd /u01/oratest/gebiz_processed
    file =$(ls -rt GEBIZ_ACS_RPO000*.ACK | tail -1)
    if [ -r "$file" ];
    then
    #HERE ONLY I NEED TO RENAME THE ABOVE .ACK EXTENSION TO .XML
    a_file=$(basename $file .ack)
    b_file="'$file'"
    c_file=$file
    echo "Filename: $a_file $b_file" && echo
    output=`sqlplus -s /nolog <<-EOT
    set pages 0 feed off
    whenever sqlerror exit failure;
    connect xgbzprod/xgbzprod
    exec XGBZ_GLSEGM_XMLTAG_PROC($b_file);
    `
    echo $output
    mv $c_file /u01/oratest/gebiz_inbound
    fi
    This is my whole script, Steps in this I am performing like :
    1> Get the file from another server where the full file name I don't have, since it is suffixed with timestamp, so I called this one like this GEBIZ_ACS_RPO000*.ACK
    2> During FTP time, once I copy to my server then I need to delete file GEBIZ_ACS_RPO000*.ACK on that server, I've full permission. How to write that one.
    3> Then inside my server I need to change GEBIZ_ACS_RPO000*.ACK to GEBIZ_ACS_RPO000*.XML. How can I write this.
    4> Changed extension file name I need to pass in my pl/sql script for processing, which I am taking care.
    5> Inside GEBIZ_ACS_RPO000*.ACK, I've xml data only. So I need to change extension of the file to GEBIZ_ACS_RPO000*.XML
    I tried to write like above mentioned but I am not getting successful and more over I am not able to rename the file. I know
    with command
    mv GEBIZ_ACS_RPO000*.ACK GEBIZ_ACS_RPO000*.xml
    I can do that but I want it in program way.
    Gurus, please help me how to write those steps, and correct me if I am doing wrong above.
    Thanks in advance for your help.
    Regards
    Nagendra
    Edited by: 838961 on Mar 30, 2011 12:22 AM

    I'd do something like this:
    cd /var/tmp
    if !wget -c --user=theuser:thepassword 'ftp://10.60.17.111/u01/oratest/gebiz_processed/GERBIZ_ACS_RPO00*.ACK'; then
        echo "FTP fetching failed.' >&2
    fi
    for fn in GERBIZ_ACS_PRO00*.ACK; do
        new=$(basename "${fn}" .ack).xml
        mv "${fn}" "${new}"
        sqlplus -s /nolog <<-EOF
            set pages 0 feed off
            whenever sqlerror exit failure;
            connect xgbzprod/xgbzprod
            exec XGBZ_GLSEGM_XMLTAG_PROC('${new}');
        EOF
        mv "${new}" /u01/oratest/gebiz_inbound
    done
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Time Machine and renamed files

    Hi. Stupid question time. External HD for TM, set up for once a week.
    I have multiple gigs of video files, for which I'm considering changing my naming convention. If I rename the files but don't make any other changes, will Time Machine back them up as new files next time? As in, the backup HD would have duplicate full-size files, one with the old name in an old backup and one with the new in the new backup.
    I suspect the answer is yes, but I thought I'd ask. Space is not an issue at the moment, but obviously if I made a habit of doing this it would be. (In which case, I'd hope to do it with one re-backup and move forward.)

    jeffdm wrote:
    Hi. Stupid question time.
    No such thing (only stupid answers.)
    External HD for TM, set up for once a week.
    Why? Why not let Time Machine work as designed, to protect you best, by doing hourly backups? Since all but one per day are deleted after 24 hours, they don't take up much space, but can really save your bacon if you accidentally change or delete the wrong file (I occasionally get distracted and click "Save" when I mean to click "Save As," for example).
    I have multiple gigs of video files, for which I'm considering changing my naming convention. If I rename the files but don't make any other changes, will Time Machine back them up as new files next time?
    Yes.
    As in, the backup HD would have duplicate full-size files, one with the old name in an old backup and one with the new in the new backup.
    Yes.
    I suspect the answer is yes, but I thought I'd ask. Space is not an issue at the moment, but obviously if I made a habit of doing this it would be. (In which case, I'd hope to do it with one re-backup and move forward.)
    The same thing will happen if you move files or folders; they'll be backed-up again. If you move a folder, all the sub-folders and files inside it will also be backed-up again. But of course only once; if they're not changed, moved, or renamed, they're not backed-up again.
    If space does become a problem, you can delete all the backups that were made from the old location, per #12 in [Time Machine - Frequently Asked Questions|http://web.me.com/pondini/Time_Machine/FAQ.html] (or use the link in *User Tips* at the top of this forum).

  • 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

  • Extracting and renaming files

    I have a multi-page document that I need to split into individual PDF files.  I know how to use the "extract as separate files" feature, but I'd also like to be able to specify the name of each extracted file.
    Namely, I'd like to name each file a different state in the US.  Is there a script or some function that could take an array of names and name each extracted file according to this array?
    Thanks!

    Here's a sample script: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.465.html
    If you create an array of state names that's in the same order as the pages in the document, you could use the following modified line:
    cPath: "/F/temp/" + filename + "_" + states[i] + ".pdf"
    You would have to define the states array at the beginning of the script, something like:
    var states = [
    "Alaska",
    "Washington",
    "Oregon",
    "Idaho",
    // Continue for other states
    "Florida"
    Obviously the folder name would be different, but you should get the idea. You can place the code in a batch sequence as in the example, or run it from the interactive JavaScript console.

  • Prelude Renaming Files Error

    I get this error when trying to ingest and rename files to my hard drive... I only get file to transcode and make alias name w/ the ext. _1. What in the process am i missing or what is it about the possible file that I am not seeing that is not allowing me to specify and ingest with a chosen file name?

    Hi Johnny,
    Could also check the AME version you are using? The latest version of Prelude is 2.2.0 and the AME is 7.2.0. Please ensure you have upgraded them to the latest version.
    If your platform is Win and you want to transcode a clip to 'QuickTime', please install QuickTime software on your machine.
    Hopfully this will resolve your issue, if not, just let me know.
    Thanks,
    Jenny

  • How to rename files that appear in multiple .book files?

    I have about 50 .fm files, and 4 .book files, each of which includes about 20 of the .fm files.
    I want to rename some of the files.
    If I open all four .book files at once, and I go to First.book and rename file Q, I want it to be renamed in all the other .book files in which it happens to be included.
    How can I do that?
    Thanks.

    You have to rename the file in each book that it is included in. After the first re-name, the other books will treat the old filename as a missing one.

Maybe you are looking for