Newbie to automater - need to rename files in a folder

Hi, I'm new to automator.
I have lots of folders of .psd files and .jpg files within each one. they are named in a particular way, that I need to change a word in each one's file name to another one of my choice, ie:
thisis_a_fileaugust.psd needs to be changed to thisis_a_filefebruary.psd
any idea if his is possible - is it easy - as its taking a while to go into each one and change it
tia

Search for "renamer" on VersionTracker or Macupdate for utilities. I use an older (when it was free) version of Renamer4Mac (2.8.2) that you might still be able to get. You'll find lots of renaming utilities. I also use PSrenamer, though it is a bit slow.

Similar Messages

  • Need a script to do the following... rename files based on folder name...

    Hi. Macophile just starting to tread the waters of Applescript, trying to use Automator but don't think it will do what I need.
    I have many images stored with-in folders that I would like to extrapolate a given number of characters from the folder name and Add Text to the files within those given folders.
    Basically...
    Folder name is C00100_Descriptive
    Files within folder are just Descriptive_01, Descriptive_02
    Would like to make all files within a given folder take the first 7 characters from the folder and Add that text to all files and files within subfolders of that folder to make the resulting files shown as...
    C00100Descriptive01
    C00100Descriptive02
    Along with this I would also like to incorporate into the script, an added step to create Thumbnail jpegs of the image files in a Subfolder under C00100_Descriptive folder.
    I can see how to do that in automator but not specifying parameters such as taking a certain number of characters from the folder the file resides in and adding that selected text to the files.
    Ideally I would like a droplet or something that I could take a bunch of folders and drop them on the droplet to perform these actions.
    Any advice, help or guidance would be really helpful! Thanks in advance.

    Awesome, you're quite welcome, glad to hear it worked for ya!! Here's another version of the script that will rename the thumb files as jpg...
    <pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
    title="Copy this code and paste it into your Script Editor application.">on run
    set theItems to choose folder with multiple selections allowed
    open (theItems)
    end run
    on open (itemList)
    repeat with anItem in itemList
    set theInfo to info for anItem
    --VERIFY THAT THE OPENED ITEM IS A FOLDER
    if folder of theInfo and not package folder of theInfo then
    --SET PATH TO THE FOLDER
    set theFolder to POSIX path of anItem
    --GET FIRST PART OF FOLDER NAME
    set folderNameStart to do shell script "echo " & ¬
    quoted form of (name of theInfo) & "|awk -F'_' '{print $1}'"
    --GET ALL FILE NAMES
    set fileList to list folder anItem without invisibles
    --PROCEED IF FOLDER NOT EMPTY
    if fileList is not {} then
    --SET PATH TO THUMBNAIL FOLDER
    set thumbFolder to theFolder & "_thumbs/"
    --CREATE FOLDER IF IT DOESN'T ALREADY EXIST
    try
    do shell script "mkdir " & quoted form of thumbFolder
    end try
    --PROCESS FILES
    repeat with fileName in fileList
    --SET PATH TO CURRENT FILE
    set oldFile to theFolder & fileName
    --PROCEED IF FILE IS NOT A FOLDER
    set oldFileInfo to info for POSIX file oldFile
    if not folder of oldFileInfo then
    --SET NEW FILE AND THUMB FILE PATHS
    set newFileName to folderNameStart & "_" & fileName
    set newFile to theFolder & newFileName
    set theExt to name extension of oldFileInfo
    set thumbName to text 1 through -((length of theExt) + 1) of newFileName & "jpg"
    set thumbFile to thumbFolder & "thumb_" & thumbName
    --RENAME FILE
    do shell script "mv " & quoted form of oldFile & space & ¬
    quoted form of newFile
    --CREATE THUMBNAIL
    --REPLACE '128' WITH MAX HEIGHT OR WIDTH OF THUMB
    try
    do shell script "sips -s format jpeg -s dpiHeight 72 -s dpiWidth 72 -Z 128 " & ¬
    quoted form of newFile & " --out " & quoted form of thumbFile
    end try
    end if
    end repeat
    end if
    end if
    end repeat
    end open</pre>

  • Need to rename files parsing date formats in the filename [SOLVED]

    Godaddy changed the naming scheme of their server logs again.  I need some perl or something magic that will convert format A to format B.  Doing this is bash is going to be painful so I'm hoping some of your perl or python ninjas out there could help me.
    format A:  ex20140425000001.log
    format B: Wed, May 21, 2014.log
    So for the example above, that date needs to be converted to this name: ex20140521000001.log
    Thanks in advance!
    EDIT: nevermind... forgot about date.
    #!/bin/bash
    for i in *.log; do
    fixeddate="$(echo $i | sed -e 's/,//g' -e 's/^....//' -e 's/.log//')"
    useitdate="$(date -d "$fixeddate" +%Y%m%d%H%M%S)"
    newname="ex$useitdate.log"
    mv "$i" "$newname"
    done
    Last edited by graysky (2014-06-07 09:41:59)

    sempervirent,
    You're asking for some pretty advanced file naming. Most people aren't going to need that sort of function, so I doubt there will be a hook into Aperture to do such a thing. I suggest using a shell script or Applescript along with EXIFTool to rename files before you import them into Aperture. http://www.sno.phy.queensu.ca/~phil/exiftool/
    Retain the unique number that the image already has
    If you're not afraid of the command line, it's easy enough to use a tool like awk or maybe perl to parse that sequence number from a well-formatted string like the picture name
    Replace "DSC" with the camera model (D3X)
    You can use EXIFTool to extract the camera model from the EXIF dat ain the photos
    Add a digit prior to the four-digit string to indicate the true numeric sequence of the file.
    Good luck with this one. You'll have to do a filename search through all of your previous files to find out what 10,000 you're on. It's possible, but you'd have to do some specialized coding in AppleScript or shell script.
    nathan

  • I need to open files in a folder within a photoshop action

    I am writing an action (to be triggered by automator) to take three photos from a tethered camera and open, size, and crop them, and place them in specific locations on a template image to create two photo-booth strips side by side on a 4x6 print.  It works perfectly, but when I write the "open" command into the action, it referenced the files by name.  I need to find a way to have my action open the three files in a folder (the only three that will be there thanks to my automator action), but not reference them by name.  Is there any way of opening images in an action without referencing them by name?  Maybe some sort of open images in a folder type of thing?  Any ideas are very much appreciated.
    ---Dan

    I have played with the >>Toggle dialogue on/off<< field and manually opened the files from their folder, but the action has the file's location written into it.  I need it to open all files in a folder.  As part of my Automator action, I am moving my photos (taken in batches of 3) into a workflow system of folders so the photos from the camera save to a "from camera" folder, and then move to a "for photoshop" folder, and those are the images that open into the ps action and get put into the template.  The action saves the composite image to an archive folder, and deletes the image layers, and then the Automator action moves the originals to another archive folder.  There shouldn't be issues as long as the actions keep running and I can figure out how to open files form a folder without referencing the specific images in the folder.  Also please keep in mind that I am writing this as an action witihn Photoshop CS3, so basically clicking record, and letting the computer write the "code".  Did that help?

  • I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sending data to Message borker.(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to save file in SAP fold

    I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sends data to Message borker(thru JMS channel).(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to create file with same data what ever send to Message broker and put the file in SAP folder without touching mapping. Is it possible? Please advise with the steps. We are using the ICO for this senario. Quick response is appriciated.

    Hi Pratik,
         http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?quicklink=index&overridelayout=true
    This link might help.
    regards
    Anupam

  • Automatically open newly added files in a folder?

    Hi there.
    I own a Nikon D80 and I want to have the images I take transfered directly to my Mac to be stored and displayed. I found this om flickr: http://www.flickr.com/groups/d80/discuss/72157603787246133/ where a user describes how to automatically add the photos to a folder on the Mac, now all I need is a script that will automatically open the newly imported photos, is it possible to do - and how? (I figured it probably had something to do with automator, but since I don't know anything about coding anything, I need some help).
    The script could either open the pictures as they are added (10 photos taken will result in a total of 10 windows when done) or replace the current showed image (10 photos taken will result in a total of 1 window when done)
    Hope it all makes sence, thanks in advance!

    All I can suggest is peruse the AppleScript forum for possible scripts or post your query there. It's under OS X Technologies. I don't do workflows, so I just pointed you to the basic starting point. Alternatively, post your query to the Flickr forum.

  • Rename file automatically when moving

    How can I rename a file automatically when moving a file from one folder to another when there is a file with the same name in the other folder?

    you can't do it automatically. you need to rename it before you move it.

  • How can I automatically rename files based on an excel doc?

    I am a scientist and recieve data files from some of my experiments with arbitrary, computer-generated names. For example, if I perform an experiment with four samples, which I name Sample1, Sample2, Sample3, and Sample4, I get back 4 data files named J30935D05.ab1, J30935E05.ab1, J30935F05.ab1 and J30935G05.ab1 along with an Excel doc that lists my names for the samples (sample1, sample 2, etc.) in one column and the computer-generated names for their corresponding files (J30935D05.ab1, J30935E05.ab1, etc.) next to them in another. Therefore, I must open the Excel file and look up which file corresponds to which sample before I can begin processsing my data. Usually these experiments involve a large enough number of samples (70-100 or so) such that looking everything up in the Excel doc gets very tedious and is quite time-consuming. Is there any way to create an automator workflow, applescript, or some other solution to rename these files based on the Excel doc? To clarify, I would like an automator workflow that would take a folder of arbitrarily named files, look up the names I have for the samples in the Excel doc, and rename the files accordingly. In the example, my folder containing files J30935D05.ab1, J30935E05.ab1, J30935F05.ab1 and J30935G05.ab1 would be turned into a folder containing the files renamed as Sample1.ab1, Sample2.ab1, Sample3.ab1, and Sample4.ab1. This example is a bit simplified, however, and trying a simple trick of just systematically renaming files within the folder would not work--both the original and the new file names must be looked up in the Excel doc, as these change dramatically from experiment to experiment. I would also need to maintain the file extension on each file after being renamed. Any help would be greatly appreciated!!

    Try the freeware utility Renamer4Mac (VersionTracker or MacUpdate).
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Rename file name & format using ftp sender

    Hi all,
    This is regarding the renaming of file at sender file(FTP) communication channel and placeing the same file in the same folder.
    At FTP server at sender side (i.e.clients place) is in .txt format.But now .txt file has to rename and change into .sav foramt with below required name convention of file.
    client format is  :  SAP_Order.txt (Pervious file name).
    We need to change the file in to "SAP_Order_yyyymmddThhmmss.sav" format..
    How can i achieve this requirement?
    Can please suggests me solutions ASAP.
    Best Regards,
    satya,

    Hi,
       if your requirement is to pick the  existing file in the FTP folder...and send as idoc to the target and place the renamed file to FTP folder...
    then its simple...
    use two receivers instead of one , one for point to target and other for sender itself... (second receiver  is for  changing  the file name format....)
    Hope the above understanding is correct...if not provide more details of your requirement...
    HTH
    Rajesh

  • How to rename files by folder name in applescript

    Hi,
    I need to be able to rename files within a folder to the folder name. I have a work flow and script that allows me to find the files within a folder, enter a new file name and starting sequence number in tow seperate dialogue boxes. What I want to be able to achieve is to rename the files without manually entering the name... I still want to be able to manually enter the number.

    Use code such as:
    tell application "Finder"
    set the_folder to (choose folder)
    repeat with this_file from 1 to (count (get files of the_folder))
    set name of file this_file of the_folder to (name of the_folder) & " " & this_file
    end repeat
    end tell
    replacing the last this_file on the fourth line with the variable which contains the number.
    (104354)

  • How to make SSIS packages automatically read the input file from a path?

    Currently I am using a SSIS package to read data from a .dat file and load it into SQL Server tables.
    I am placing the input .dat file on the desktop. In the connection manager -> Browse option, I am pointing this file to create connection.
    The file naming convention is like - aSNAP_Data_20140926_P-2014-09-26_07.02.36
    However, I need the SSIS package to automatically read the input file from a folder which is located in a remote server. This folder has lots of files where input files are added on a daily basis with the date value in the file name as mentioned above.
    I want to schedule the SSIS package to run daily and take the latest file in the folder based on the date.
    Please let me know how to do it. Any help would be highly appreciated.....
    Thanks in advance.

    Hi SQL_SSIS_Dev,
    According to your description, you want to get the latest file from a path to a SQL Server table. After testing the issue in my environment, we can refer to the following steps to achieve your requirement:
    Create two variables, VarFolderPath stores the folder path in which our files exist, VarFileName hold the value of most recent File Name.
    Drag a Script Task from SSIS Toolbox to Control Flow Pane, then select “User::VarFolderPath” as ReadOnlyVariables, select “User::VarFileName” as ReadWriteVariables.
    Then Edit Script with the C# code below:
    Add “using System.IO;” into namespace.
    Add the code below under Main function:
    var directory= new DirectoryInfo(Dts.Variables["User::VarFolderPath"].Value.ToString());
                FileInfo[] files = directory.GetFiles();
                DateTime lastModified = DateTime.MinValue;
                foreach (FileInfo file in files)
                    if (file.LastWriteTime > lastModified)
                        lastModified = file.LastWriteTime;
                        Dts.Variables["User::VarFileName"].Value = file.ToString();
    Drag a Data Flow Task to Control Flow Pane and connect to Script Task.
    In the Data Flow Task, drag a Flat File Source with a file in the source folder as all the files have same structure as the File name.
    Add the property below the Flat File Connection Manger expression:
    Property: ConnectionString      Expression: @[User::VarFolderPath] +"\\"+ @[User::VarFileName]
    Drag an OLE DB Destination that connect to the Flat File Source, then configure a table to store the data.
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Renaming files in a book

    Hi everyone,
    I need to rename files in a book, but from within the book. A Save as... won't update the cross refrences.
    I see an fcode for this (FCodes.KBD_BOOKRENAMEFILE), but I've been advised not to rely on these types of shortcuts.
    I don't see anything else documented in the Scripting Guide. Does anyone else have any other suggestions?
    Thanks so much!
    Heather A

    Just following up for anybody else who might need this in the future.
    My hangup was that pulling files from the book itself created Doc objects, not File objects (beginners mistake, you hate to see it). Anyway, here are some of the functions that I came up with to handle this task for anybody who needs it. Please be warned, this is quite literally my first ExtendScript project so this may not be the most efficient way to have done this (I'm always open to constructive criticism from those more experienced than myself). I know I went overkill with notes in the code, that was requested by colleagues who know less about code than I do so that if I were no longer employed for some reason another person could come in and understand exactly what the code was doing.
    function fileNameReplacer(FullArray, CodeBook, BookFile) {
        /*The fileNameReplacer steps through all of the files in the book looking for those who need to be renamed.
            The function first renames all of the files, and then cycles through each file's Crossreferences and updates the
            names to reflect name changes*/
        /*Local variables are created*/
        var FileName,
            BookName,
            FilePath,
            FullName,
            FileType,
            EncodedName,
            OldName,
            NewName,
            ThisFile,
            OpenFile,
            FileArray;
        FileArray = FullArray;
        /*Loops through all of the files in the book*/
        for (var i = 0, len = FileArray.length; i < len; i++) {
            /*Tests if the file is type 255 which would signify it is a folder or a group (These will not be renamed and would throw errors)*/
            if (FileArray[i][0].type == 255) {
                /*If the file is identified as a group or folder, it is removed from the Array with the "splice" command*/
                FileArray.splice(i, 1);
                /*The counters for this loop are then adjusted to reflect the new length of the "FileArray" variable*/
                i = i - 1;
                len = len - 1;
                /*Starts the next round of the loop (which is actually repeating the same loop but without the group or folder in the Array)*/
                continue;
            /*If the file being looked at is not a folder or group, it is assigned to the "ThisFile" variable*/
            ThisFile = FileArray[i][0];
            /*Checks the file to see if it's element catalog has values. If there are no values, it would mean that there is no data from which
                to develop the encoded name, and likely means the file is something like a cover page or table of contents which do not need encoding*/
            if (ThisFile.ElementCatalog.length !== 0) {
                /*If the element catalog has items in it, the name of the current file being examined is assigned to the "FullName" variable*/
                FullName = ThisFile.Name;
                /*The FullName is then split into an array at each backslash (Backslashes in JavaScrip have their own meaning, in order to
                    input a single backslash two must be used). The last item of the array is the file name which is assigned to the "FileName"
                    variable using the "pop" command*/
                FileName = FullName.split("\\").pop();
                /*The FileName is then split at the period, and the file extension with a leading period is assigned to the "FileType" variable.*/
                FileType = "." + FileName.split(".").pop();
                /*The file path without file name is assigned to the "FilePath" variable. This is done by identifying where in the "FullName" variable
                    the "FileName" begins, and then taking a substring of the "FullName" up to that point.*/
                FilePath = FullName.substr (0, (FullName.indexOf(FileName)));
                /*The new encoded file name is found by running the current file through the nameEncoder function along with the Abbreviation List
                    (Called "CodeBook" in this function). The value produced by the nameEncoder function is assigned to the "EncodedName" variable*/
                EncodedName = nameEncoder(ThisFile, CodeBook);
                /*The encoded name and original name are then assigned to locations 2 and 1 in the File array respetively*/
                FileArray[i][2] = FilePath + EncodedName + FileType;
                FileArray[i][1] = FullName;
                /*The old name and new name are compared to see if a change has actually occurred*/
                if (FileArray[i][1] === FileArray[i][2]) {
                    /*If no change has occured, the file is removed from the array using the "splice" command, since it will only slow down later processes.*/
                    FileArray.splice(i, 1);
                    /*The loop counters are updated to reflect the change in FileArray length*/
                    i = i - 1;
                    len = len - 1;
                    /*Starts the next round of the loop (which is actually repeating the same loop but with the file not requiring renaming removed)*/              
                    continue;
            } else {
                /*If the element catalog for the current file does not have any values it is removed from the "FileArray" using the "splice" command*/
                FileArray.splice(i, 1);
                /*The loop counters are updated to reflect the change in FileArray length*/
                i = i - 1;
                len = len - 1;
                /*Starts the next round of the loop (which is actually repeating the same loop but with the file lacking elements removed)*/
                continue;
        /*At this point the FileArray contains only files that can, and have been renamed; along with their current and new names*/
        /*Loops through all files in the FileArray*/
        for (var l = 0, lenA = FileArray.length; l < lenA; l++) {
            /*Assigns the current file, its old name, and its new name to the "ThisFile", "OldName", and "NewName" variables respectively*/
            ThisFile = FileArray[l][0];
            OldName = FileArray[l][1];
            NewName = FileArray[l][2];
            /*Opens the current file assigned to "ThisFile" as a File object. File objects allow for changes on the drive itself to be made, while
                changing the .Name attribute of a Doc object will not. This allows for the encoded names to be applied directly to the files themseves.*/
            OpenFile = File(ThisFile.Name);
            OpenFile.rename(NewName);
            /*Changes the file's label to the value of "NewName" and removes the file type (as the label does not show file type)*/
            ThisFile.Label = NewName.split(".").shift();
            /*Changes the PrintFileName value to the value of "NewName" with the file type changed to ".ps"*/
            ThisFile.PrintFileName = NewName.split(".").shift() + ".ps";
        /*Traverses all files in the books and renames the target the book is looking for. If this is not done, the book will still think the old names exist and will
            try to find them to no avail. "traverse" function sends each component in the book through another function,
              in this case the bookComponentRenamer, and supplies the second function with a parameter, FileArray here.*/
        traverse(BookFile, bookComponentRenamer, FileArray);
        xrefRenamer(FullArray, FileArray);
        /*Saves the book file with the updated component names*/
        BookFile.SimpleSave(BookFile.Name);
        /*When the book is closed, the BookFile variable will no longer function. Assigning the current books name to the "BookName" varibales will allow the book to be reopened*/
        BookName = BookFile.Name;
        /*All open files are closed*/
        closeAll();
        /*Curent book is reopened*/
        BookFile = openBook (BookName);
        /*All book files (now with updated names) are opened*/
        traverse(BookFile, openfile);
        /*Returns the updated book back to the location that originally called the fileNameReplacer function*/
        return BookFile;
    function bookComponentRenamer(Component, FileArray) {
        /*The bookComponentRenamer compares the current book component with names on the FileArray (these are files that have name changes.
            If a match is found, that compent's name is changed within the book itself. This ensures that the names the book file is looking for reflect the updated file names created by this program*/
        for (var i = 0, len = FileArray.length; i < len; i++) {
            if (Component.Name === FileArray[i][1]) {
                Component.Name = FileArray[i][2];
    function xrefRenamer(AllFiles, RenamedFiles) {
        var ThisFile,
            ThisXREF,
            NextXREF,
            OldName,
            NewName,
            XREFTest;
        for (var i = 0, len = AllFiles.length; i < len; i++) {
            /*Assigns the first cross reference in the current file to the "ThisXREF" variable*/
            ThisFile = AllFiles[i][0];
            ThisXREF = ThisFile.FirstXRefInDoc;
            /*Whether "ThisXREF" contains a valid cross reference (having a null value means the file has no cross references, or we have already
                looped through them all and can proceed to the next file in the FileArray)*/
            while (ThisXREF.XRefFile !== null) {
                /*Assigns the next cross reference in the file to the "NextXREF" variable*/
                NextXREF = ThisXREF.NextXRefInDoc;
                /*Loops through all of the files in the FileArray. This will let the current cross reference be compared to the files being renamed and see if
                    there are any matches*/
                for (var j = 0, lenA = RenamedFiles.length; j < lenA; j++) {
                        /*Assigns the old name and the new name of the file being compared to cross references to the "OldName" and "NewName" variables respectively*/
                        OldName = RenamedFiles[j][1];
                        NewName = RenamedFiles[j][2];
                        XREFTest = ThisXREF.XRefFile.indexOf(OldName);
                        /*Tests if the current cross reference being examined links to the current comparison file*/
                        if (0 <= XREFTest) {
                            /*If yes, the cross reference is updated with the new name*/
                            ThisXREF.XRefFile = ThisXREF.XRefFile.replace(OldName, NewName);
                            /*Ends the comparison loop for this cross reference as the correct replacement has been found*/
                            break;
                /*Assigns "ThisXREF" with the value of the "NextXREF" the comparison loop starts again*/
                ThisXREF = NextXREF;
            ThisFile.SimpleSave(ThisFile.Name);

  • Rename files with a given string

    Can anyone please help with the following code. I need to rename files with a given string. My code is:
    import java.io.File;
    public class RenameFile
         public RenameFile()
         void naming(File destFiles, String rename)
              System.out.println("destFiles:"+destFiles.getName());
              //output: destFiles:C:\temp\store\test.abc
              //output: destFiles:C:\temp\store\test.def
              //output: destFiles:C:\temp\store\test.ghi
              System.out.println("rename:"+rename);
              //output: rename:pmnr
              String name=destFiles.getName().toString();
              System.out.println("name:"+name);
              //output: name:test.abc
              //output: name:test.def
              //output: name:test.ghi 
              String ren="";
              ren=name.replaceAll(name,rename);
              System.out.println("ren:"+ren);
              //output: ren:pmnr
    My files I am getting from "destFiles" are:
    C:\temp\store\test.abc
    C:\temp\store\test.def
    C:\temp\store\test.ghi
    which I need to rename as:
    C:\temp\store\pmnr.abc
    C:\temp\store\pmnr.def
    C:\temp\store\pmnr.ghi

    "I seem to remember telling him this recently...
    Probably but unless the OP takes an interest in the replies we are just wasting our time. "
    Sorry, there has been a misunderstanding. I take full interest in all the replies.
    About renaming, I had got the solution from sun.com, it works fine when I am passing all the files in the source directory to the destination directory. But since I am passing only a selected few files from source to destination, I have changed my code and the previous solution is not working now.
    Anyway, below code is working and thanks a lot
    String newFileName = destFiles.getName().replaceFirst("[^.]*", rename);
    File newFile = new File(destFiles, newFileName);
    destFiles.renameTo(newFile);

  • Unable to rename file's

    i am trying to rename files in a folder nine
    files name are taken from the text file dnine.txt
    were for every occurance of a number in the filename
    i wrote this code it reaches the condition as marked bold but it isnt renaming the files
    plzz help
    import java.io.*;
    import java.util.*;
    class nan
    {     public static void main(String S[]) throws IOException
         Scanner track = new Scanner(new File("dnine.txt"));
         String [] Sme;
         Sme=new String[30];
         int i=0;
        while (track.hasNextLine())
        {Sme=track.nextLine();
    i++;      }
    File dir = new File("nine");
         String[] ch = dir.list();
         Arrays.sort(dir);
         String temp,temp2;
         File f[] = new File("nine").listFiles();
    for (i=0; i<ch.length; i++)     
    for (int j=0; j<Sme.length; j++)          
         {     temp2=""+j;
              temp="2X"+temp2+Sme[j]+".txt";
              *if(ch[i].indexOf(temp2)!=-1)          *
         {     File file = new File(ch[i]);
         File file2 = new File(temp);
         boolean success=f[i].renameTo(file2);
         System.out.println(ch[i]+success);

    Are you getting some sort of error? If so copy and paste the entire error message here and indicate on which line the error occurs.
    P.S. For the love of [insert deity], please make your code indentations consistent.

  • Difficult to Rename Files (Finder windows keep Refreshing)

    Has anyone else noticed how difficult it is to rename files in a folder? It is almost as if Leopard's Finder keeps refreshing (or building thumbnails) or something. Here is my scenario:
    - Browse to a folder (in my case a folder with large files)
    - Hit enter on a file and start renaming the file
    - After 1-2 seconds, finder jumps out of edit mode by itself (as if the page somehow refreshed)
    - Hit enter again and keep on editing
    - 1-2 seconds later, jumps out of edit mode again.
    - Leave the window for 20-30 seconds
    - Then hit enter, then it is easy to rename the file.
    - Thereupon, immediately try to edit the next file, and bam, it exits edit mode after 1-2 seconds (almost as if the previous file rename triggered a 'refresh this entire view' event)
    It is incredibly annoying to attempt to rename a bunch of files with Leopard.

    Ah - I cant seem to get into the habit of "get info" to rename my files. It seems counter productive.
    Is there any other workaround / fix to make the finder stop jumping me out of renaming a file?
    It is incredibly annoying. I will get a few characters typed in, and it will jump out of editing... and then to add insult to injury, the folders is updated and the file jumps to its new alphabetical location in the list - So I have to go find the partially named file to finish the job.
    People ask me if I like Windows or Mac. I say both have benefits and weaknesses. Renaming files is one of my Mac's weaknesses - it seems. It shouldn't be - it is a basic part of an operating system.
    Help!

Maybe you are looking for

  • Java Mapping in NWDI.

    Hi experts, I want to develop a Java Mapping in NWDI for SAP XI 3.0. To do this, I need to use the library aii_map_api.jar the J2EE Engine of SAP XI. To use the library in the DC's created in NWDI, I need to define the dependencies with the SCA that

  • Migrating from JSF 1.1 to 1.2

    Hi folks, My curent app uses JSF 1.1. I want to move to JSF1.2 which is the latest release. But when I try to deploy my app in Oracle App server after replacing new libs, I am getting error as Exception: NoClassDefFoundError: javax/el/ExpressionFacto

  • Constant 3G Drop Every 2 Minutes!

    Hi there, I've had many problems with the network and was looking to see if everyone had the same issue or it was just me. I've updated my OS to 3.1.3 but what happens is, is that 3G constantly seems to turn off every 2 minutes or when I am sending a

  • HT203167 I have lost everything and want to get it all back...apps, music, etc.  how do I do this?  no I didn't make backups

    My iPod, Ipad, and iPhone 4 have all m data and apps abd music but my computer is hosed and I tried downloading itunes again after I uninstalled it. how do I gewt it all back?

  • Help: Recovery Image (restore)

    I recently had to restore my Windows 8 system due to the repair cycle going into a loop.  I had the computer create a backup image on DVDs to restore later.  The computer said there would be 11 discs needed, but it only used 10.  I assumed this was s