Batch Rename Order Getting Mixed Up

When batch renaming a large amount (usually over 100) of RAW NEF photos, in the format of YEAR_Month_DAY_TIME_#### (where #### is a 4 digit sequence number) EX/ 2014_10-25-122506_0001, the files get renamed and when sorted by file name are in order, however the 4 digit sequence number gets mixed up somewhere along the way.
It usually happens after the mid hundreds.
Example, I had apx 900 images in one folder I batched renamed, and the sequence number progressed properly from _0001 to _0191, but then the next image went straight to _0232.
Any one else experience this issue or have any ideas as to a solution?  Very frustrating issue.
Thanks!

Thanks, Tulse... i'm glad that it's an issue that can be reproduced by others. I'm amazed that it hasn't come up (perhaps it has) in the time since Keynote was released. I'm even more amazed that what seems like such a significant bug hasn't been addressed yet. I just hope a new version of Keynote is coming soon that will address things like this.
The reason i'm doing so many build ins and build outs is because i want the content of the slides to transition independently of the background. This is something i would love to see in the next version of Keynote.
For example, i'm using a looping video clip as the background, with our company logo superimposed over it. I'd like for the foreground text and other graphical elements to transition from slide to slide, but leave the background constantly looping. So instead of an empty black "stage", i can have 3D effects applied at the slide level without disturbing my own background.
Anyway... i tried using the blank slide as an intermediary and did not have the success that you did. Build orders still ended up different from those on the master slide.
I wonder if the builds need to be created in the order in which i want them to appear... it seems like new slides may be ignoring the order in which the builds have been dragged around in the Build Order inspector on the Master, and instead, executing them in the order in which they were created.

Similar Messages

  • File Batch Rename Errors

    I am renaming a lot of files using Bridge Batch Rename and get errors on some of the files.  I have a Windows 7 Professional 64 bit computer running Photoshop CS6.  Bridge version is 5.0.1.23 x64.  I am renaming files using this format - YYYYMMDD-HHMM-XXX-D700, where XXX is a sequence number.  I select an entire folder of images, set the sequence number to 1 and click "Rename".  Most work correctly, but in a few cases I will get several images where the Date and Time number are incorrect.  I know the YYYY is incorrect, but have not looked in enough detail on the other numbers.  I may get 2010 instead of 2007.  If I select these again and Rename I get the correct name. 
    These are NEF files with sidecar files. 
    I will pay more attention to the errors and supply more detail - I have a lot more to rename. 
    Anyone else experience these type errors?

    A card reader was used to copy the NEF file to a folder on the computer.  They were initially renamed using the Batch command in Bridge of Photoshop CS5 using the format YYYYMMDD-XXX-D700, where XXX is a sequence number.  Files were in date order when renamed.  I did not experience any problems with these renames, I only renamed the NEF files.  I also copied the jpg files from the camera, but did not rename them.  I processed the NEF files using Adobe Camera RAW and generated jpg files. 
    I decided to modify the name to allow mixing images from multiple cameras and have them sort in the correct order by date and time shot.  I selected the renamed NEF files in Bridge (Photoshop CS6 now), modified the name to YYYYMMDD-HHMM-XXX-D700 and clicked the rename button.  The sequence number was assigned based on the file order, but the YYYYMMDD and HHMM values were incorrect on a few files.  The incorrect file names were all the same for the YYYYMMDD and HHMM values, sequence numbers were correct, incorrect named files were in sequence order (a group of adjacent files).  The correct YYYYMMDD was 20080630, but the incorrect value was 20100222 and incorrect HHMM was 2042.  The incorrect named files appeared at the end of the list since the date was 2010 instead of 2008, but they had the correct sequence number.  I selected the group of incorrect named files, set the sequence number to the correct value for the first file, clicked rename and they were named correctly.  The number of incorrect named files varies - 5 of 64, 3 of 77, 6 of 59, 12 of 88, 1 of 434.  All of these files have sidecar files since they were processed using Adobe Camera RAW and these files are in the same folder.  The sidecar files are named the same as the NEF file. 
    I also renamed the JPG files that were generated from Adobe Camera RAW and did not experience any problems with names in these files to date. 
    I also tried using Photoshop CS5 Bridge to rename the a group of NEF files and get the same problem. 

  • Batch Rename---in Random Order

    Is it possible to batch rename a set of files in a random order? 
    Making a slideshow of a number of events, but I don't want them in the order shot.  I can manually rename and move them, or I could sort by some other order than by name or date, such as file size, I guess, but those options haven't randomized the collection as well as I would like.
    Just askin'...
    Thanks in advance.

    I’m not great with Scripts, but this might work:
    // adds random five digits numbers at the beginning of jpgs’ filenames in a folder;
    // use it at your own risk;
    var theFolder = Folder.selectDialog ("select folder that contains the files to be renamed");
    // for renaming other files than jpgs change the term in the brackets accordingly;
    var theFiles = theFolder.getFiles ("*.jpg");
    for (var m = 0; m < theFiles.length; m++) {
    var theRandomNumber = String(Math.random()).slice(3,8);
    File(theFiles[m]).rename(theRandomNumber + "_" + (theFiles[m]).name)
    One can copy the text into a new file in ExtendScript Toolkit (which should be part of Photoshop’s installation) and start running it by hitting the play-button or save it as a jsx-file into Photoshop’s Presets – Scripts; but it really doesn’t do anything within Photoshop, so it may be better not stored there.
    Anyway it’s probably be best to run it only on a copy of a folder, because getting the numbers back off later on might be bothersome.

  • Help: Batch Renaming in Predefined Order

    I couldn't find the answer on here, hopefully someone can redirect me or help me out.
    There's a feature In Photostation, another metadata editing software, that I assume should be in Bridge although I can't figure out how to do it. I frequently get a folder of up to 20 photos, which are named based on when the photographer shot them during the photo shoot. I have to rename them to our standard naming convention, but reorder them so they are listed in the order they show up in a layout. In Photostation, I can look at the folder, select them one at a time while holding the shift key, and then when I batch rename, the program renames the images in the order I had selected. them So the 5th photo now becomes 1, the last one 2, the third one 3 etc etc.
    Is there any way to do this in Bridge? It looks like it just does a straight one to one rename, the first of the original file names becomes the first in the new file names the second the second etc etc.
    Any help would be appreciated.

    Is there any way to do this in Bridge? It looks like it just does a straight one to one rename, the first of the original file names becomes the first in the new file names the second the second etc etc.
    To my knowledge selecting with shift does not rename them in that order. You have however different options for sorting using the sort filter and you can also place them in a manual order (not that nice working as only click in the order as you wish). When having the files in the correct order using batch rename should rename the files in the shown order either descending or ascending according to the selected option.

  • PS 6 W7 64 - Bridge when I batch rename both monitors turn into film strip with no way to get back. please help me

    Is there something I am missing about settings with a second monitor? When I batch rename in bridge both monitors (or if I shut one, the remaining one) go into uge vertical images that stream horizontally, with no way to get back to grid or normal view even though essentials is active.

    Try a reset (click on that down pointing arrow) and also  if you have a Mac, toggle the green resize button. It usually forces Bridge to resize to the screen.
    If worse comes to worse, reset Bridge's Preferences as explained here: Troubleshoot errors, freezes | Adobe Bridge | Windows, Mac OS
    When I use a external larger monitor, I select just that monitor.

  • Batch rename of PSD, Save as JPEG, file gets old name

    I am using PS CS3 Suite. I have done a batch rename in Bridge CS3 of a folder of PSD files. When I subsequently save one as a JPEG it gets the old file name. Why?

    Thanks - 7.0.1 installed and still the same problem.
    I have narrowed things down a bit.
    It seems if I create a new doc 2400x3000 for example I can convert it to a jpeg no problem.
    If I start with 3600x3600 I get the problem. Same steps as the above file with the only difference being the size.
    Anyone have a solution for this as it seems like it is size related (note that I have created at this size before and never had this problem).
    Thanks.

  • Bridge CS5 Win Batch Rename sets milliseconds to 000

    Am using BridgeCS5 (Windows7) to Batch Rename (either during download from Lexar Card Reader using Bridge, or during download from Canon 7D with Cable via Bridge- or to batch rename files already in a folder within Bridge)
    when I use YYYYMMDD_HHMMSS_milliseconds, milliseconds are set to 000 (thus photos are not in order necessarily if photos taken during burst mode), yet if I use YYYYMMMDD_HHMMSS_milliseconds, it sorts properly.
    Have tried this multiple times, and it is *usually* reproducable - I did a batch rename on a subset of photos, and Bridge got the rename right, but then did a batch rename on the entire lot of photos, and preview said it would set the milliseconds to 000, even on the photos it got right in the subset-experiment
    I need to use numeric month designation (MM) for proper file sequencing, as alpha (MMM) puts months out of chronological order.
    I did NOT notice this problem in the past (say, 3-4 months ago) but it is possible I missed it.
    I am NOT syncing multiple cameras or trying to integrate files from multiple cards.
    BridgeCS5 is up to date with all patches.
    (I checked the EXIF data on the files themselves, and it is correct, the milliseconds denote the proper image sequence, the camera is recording the files to card in correct sequence - in fact, exloring the card, all images are in proper sequence)
    By having files renamed (without a sequence number added to the batch rename configuration) with milliseconds to 000, not only are they out of order, but Bridge is willing to have several files with the same exact name.
    I'd be interested in a solution that allows me to continue using Bridge only for my workflow.
    thanks - stir

    Hi-
    I see milliseconds (Canon 7D) listed as
    (see Advanced tab)
    3rd folder down titled "exif Properties"
    eg: exif:DateTimeOriginal: 2011-07-30T10:43:12.64-04:00  whereby the camera has ordered the photos using 10:43:12.64, 10:43:12.99, etc when writing to the card.  (I intepret the .64 and the .99 in these examples to be the milliseconds - am I mistaken?)
    Realizing of course, the fact that Bridge is setting milliseconds to 000 is not the biggest concern, the biggest concern is that the photos are out of order when they are imported using the Batch Rename YYYYMMDD (but not when using YYYYMMMDD - notice the three M's there)
    This error occurs whether telling Bridge to sort specifically via Time or not - Bridge (when using YYYYMMDD) will reorder the images even if I don't add HHMMSS and milliseconds to the sort, or even if I do - the problem seems to be the YYYYMMDD - it may also be other Date-sorting, but so far I have only used the one (that doesn't work) and the other (that does, but is useless for keeping the dates/months in numerical order)
    Again, on CF card, the photos are properly ordered, as evidenced by the subject matter and the milliseconds shown in the DateTimeOriginal exif data
    But in Bridge, when batch renaming, the order of the photos is mixed up, and this is evidenced by the new file names (say, if I add a sequence number to the rename)
    btw, I have Bridge rename set to preserve XMP data and original file name, but whether I do or not doesn't seem to matter.
    I'm shooting JPGs in Burst Mode (shouldn't matter, as the files on card are properly ordered)
    (so far I have had 2 Canon reps tell me there are no milliseconds, but the exif data clearly shows that, I think? - I have sent them a screen shot of the file info, showing the exif field, and have not since heard a response saying "nuh uh"... it's still early in the day, though they normally respond within 30 minutes)
    Thank you for your time - Stir

  • Molt: batch renaming utility

    Hi all,
    Recently I was looking for a batch renaming utility, and while I did find a few, none of them would really fill all the checkboxes of my requirements list. Either because they didn’t provide the "rules" I was looking for, or because they would rename files after each rule has been applied, or because they couldn’t be used from scripts (that way I wanted), or whatever the reason. So I made myself one: molt.
    You use it by specifying a set of rules to use, which will all be processed to determine the new name. molt will make sure those new names are "free," as in not already in use; and handles "avoidable conflicts" - when a file's new name is taken by another file to be renamed (performing two-steps renaming with a temporary name if needed).
    Usage: molt [OPTION]... RULE... [FILE]...
    Options :
    -D, --exclude-directories Ignore directories from specified files
    -F, --exclude-files Ignore files from specified files
    -S, --exclude-symlinks Ignore symlinks from specified files
    -i, --from-stdin Get list of files from stdin
    -P, --process-fullname Send the full path/name to the rules
    (Imply --output-fullname)
    -p, --allow-path Allow (relative/absolute) paths in new filenames
    (Imply --output-fullname)
    -m, --make-parents Create parents if needed
    -O, --output-fullname Output full path/names
    -B, --output-both-names Output the old then the new filename for each file
    -N, --output-new-names Output the new filename for each file
    -R, --only-rules Only apply the rules and output results,
    without any conflict detection
    (Imply --dry-run)
    -n, --dry-run Do not rename anything
    -C, --continue-on-error Process as much as possible, even on errors
    or when conflicts are detected
    -d, --debug Enable debug mode - Specify twice for verbose
    output
    -h, --help Show this help screen and exit - Specify twice for
    verbose output
    -V, --version Show version information and exit
    Rules :
    Rules are the part of molt that process filenames. Rules will be applied
    in the order specified, you can use the same rule as may times as you want.
    Some rules require a parameter, what it can be depend of the rule. Usually,
    it will be a string where you can specify multiple parameter using slash ( / )
    as separator.
    --upper Convert to uppercase
    --lower Convert to lowercase
    --vars Resolve variables
    --tpl PARAM Apply specified template (resolve variables)
    --sr PARAM Search & replace a string
    PARAM = search[/replacement[/option]]
    If no replacement is specified, the string will be removed.
    Search is case-sensitive, unless option i was specified.
    --camel Convert to Camel Case
    --list Use list of new names from stdin
    --regex PARAM Search & replace using regular expression
    PARAM = pattern[/replacement[/option]]
    If no replacement is specified, the string will be removed.
    Search is case-sensitive, unless option i was specified.
    Variables :
    You can use variables in the new filenames. The syntax is to put the
    variable's name in between dollar signs, e.g: $FOOBAR$
    You can also (if supported) specify one (or more) parameters, using colon
    as separator, e.g: $FOOBAR:PARAM1:PARAM2$
    Variables are not automatically resolved, you need to use the rule --vars
    in order to have them resolved, which gives you the ability to determine
    when resolving happens, and continue processing with more rules afterwards.
    Note that rule --tpl also resolves variables.
    NB[:PARAM...] Counter, incremented for each file using it
    You can specify up to 3 parameters:
    - the minimum number number of digits (padding with 0's)
    - the starting value of the counter
    - the increment (can be negative)
    E.g: $NB:3:42:-2$ will resolve as 042, 040, 038, etc
    _[:PARAM...] Magic variable: specify "variable" as parameter
    The first parameter is the name of the "variable" to resolve.
    Resolving is done running the corresponding command line, using output
    as value (removing trailing newline (\n) if present)
    Links:
    - Slightly more verbose description
    - Source code
    - PKGBUILD in the AUR
    Hopefully someone may find it useful.
    Cheers,
    -jacky

    Yes, this works. However, this was already part of my workflow.... and not where the trouble lies.
    After exporting jpeg images from Aperture, they carry the same name of the original RAW files, from which they came. (So, IMG_8342.jpg would have started it's life as IMG_8342.CR2.) But we dont' send them out like that. We sequentially name them 0001_image.jpg, 0002_image.jpg, etc... So after renaming, how do you find the original file again, right?
    BEFORE the renaming phase, I would run the "Store Original Names in Spotlight Comments" action. That way, I could look at the comments for a derivative .jpg—whose name has now changed—and determine the name of the ORIGINAL file.
    After renaming, the derivative file might end up being named 0361_image.jpg, but it's Spotlight comments would say, for example, Original Name:<<IMG_8485.jpg>>. Then I would know that this particular file started off as IMG_8485.CR2.
    As such, I could quickly/easily backtrack, knowing that the original RAW file was named IMG_8485.CR2
    The issue is that once you've gone thru the effort to ADD these spotlight comments, if you THEN go through a re-naming step, this erases all those Spotlight Comments. That was my problem... Getting the Spotlight Comments in place was never the issue. KEEPING them there was the problem.

  • Batch Rename Issues - CS5 - Win7

    Bridge (4.0.2.1) will not Batch Rename in sequential order.  Have tried several times on different folders and get the same results each time.
    For example:
    Folder with 280 images.  I request a Batch Rename in Same Folder, numbered sequentially starting with 001+JobName+Original File Name.jpg.
    What I get is:  sequential 001 to 051, then 096, 098, 100, 102 - 106, then 052 -107, then doubles -  2x 108, 2x 109, 2x 110, 2x 111, 2x 112, 2x 113, 2x 114, 2x 115, 2x 116, 2x 117, 2x 118, 2x 119, 2x 120, then 121-258.
    I've never experienced anything like this, ANY HELP APPRECIATED!!  I do not want to name over 1000 total files by hand!

    Is this really an Adobe Reader problem?

  • Batch Renaming Image Files from a list of names

    I would like to use the batch rename function in Bridge CS5 to quickly rename newly uploaded image files of our products.  I would like to rename the image to it's corresponding product number.  The issue is that the product numbers aren't in exact numerical order (ie.  the first pic is of product ES2004 and the next one is for ES2012).  The product numbers can sometimes end with a letter or a number.  The pictures are taken in order of the product numbers on an excel sheet.  What's the easiest way to have bridge name the image file to its corresponding part number? 

    Here is an example script that will do the re-naming also place the original filename into the metadata.
    CSV format is fileName,Product IE:
    p1020337.jpg,E179562
    p1020338.jpg,Z556301
    Copy and paste the script into ExtendScript Toolkit (This gets installed with Photoshop)
    Open Bridge
    Edit > Preferences > Startup Scripts
    Click "Reveal My Startup Script"
    Save the script into this folder.
    Close and restart Bridge and accept the new script.
    To use, navigate to the folder with the documents to rename, "Right mouse click Menu" select "Rename to Product" and select your csv file.
    #target bridge 
    if( BridgeTalk.appName == "bridge" ) { 
    fileNameToProduct = MenuElement.create("command", "Rename to Product", "at the end of Thumbnail");
    fileNameToProduct.onSelect = function () {
       renameToProduct();
    function renameToProduct(){
    var Path =app.document.presentationPath;
    var descFile = File.openDialog("Open Product File","CSV File(*.csv):*.csv;");
    if(descFile == null) return;
    descFile.open('r');
    var datFile=[];
    while(!descFile.eof){
    var line = descFile.readln();
    if(line.length > 5) datFile.push(line);
    descFile.close();
    for(var t in datFile){
    var str=datFile[t];
    str= str.split(',');
    var fileName = File(Path+"/"+ str.shift());
    var product = str.shift();
    if(!fileName.exists) continue;
    var ext = fileName.toString().toLowerCase().match(/[^\.]+$/);
    var thumb  = new Thumbnail(fileName);
    var md = thumb.synchronousMetadata;
    md.namespace = "http://ns.adobe.com/xap/1.0/mm/";
    md.PreservedFileName = thumb.name;
    $.sleep(100); //give it time to update the metadata
    var newName = product + "." +ext;
    fileName.rename(newName);
    alert("All done");

  • Batch rename by date created??

    I made the huge mistake of setting up my camera to restart the image count everytime I put a new memory card in, then I transfered them all to my computer, erased the cards only to then realize I've got a bunch of photos with the same name.  Not a huge problem but now Lightroom only finds one of the two files with the same name.
    My solution is to do a batch rename in Bridge but that didn't work because it used the file names for the order.  What I want is all the files to be name 0001-1500 in the order they were taken.  Can this be done?
    Other ideas?  Or maybe someone knows how to get Lightroom to see both?
    Thanks...

    My solution is to do a batch rename in Bridge but that didn't work because it
    used the file names for the order.  What I want is all the files to be name
    0001-1500 in the order they were taken.  Can this be done?
    In Bridge use the path bar icon (showing sort by filename, top right side
    Bridge window) and change this to date created, now they will be showing in
    two separate sequence order groups. Select the files per session and then
    choose batch renaming.
    If you don't have the path bar active use the menu view-sort.
    Be aware that you can auto rename the files in both Lightroom and Bridge
    (with Photodownloader) during file ingestion from card reader. You might
    also want to include the creation date (yyyymmdd) and sequence number to it
    so it auto renames them to a correct date and when choosing a 4 digit
    sequence number it is very unlikely double filenames will happen ever again,
    regardless the settings in camera

  • Batch Rename with String Replacement?

    Is there a convenient way to batch rename files after they've been imported? The template mechanism seems to work well for creating new names, but not for renaming. For example, I originally imported and renamed my images to look like this:
    Zemke_YYMMDD_NNN-O1.CR2
    I decided I would rather have DRZ (My initials) instead of "Zemke" as the prefix. I was able to get it done with some contortions:
    Metadata/XMP/Export
    Remove all files from Lightroom
    Rename all the external files to start with DRZ
    Reimport all the files
    Delete the XMP files
    I think what is needed is for Rename to include string replacement (and string deletion) functionality. Is it already there?
    Dan

    Stefano, nonadjacent selection can be done by holding down Control and manually selecting the additional image. If you want to select a lot of separate ranges, the way to do it is to add each range to the quick collection (press the B key), then go to the quick collection and select all. It's exactly for those kinds of scenarios that quick collection exists. Once you get used to doing it, it's easier working with a "sticky" selection like the quick collection rather than the contortions required to extend standard selections.
    To slightly add to Rory's comments: two-digit year plus spelled out month names and day of the week names are also available. Combine into any order you want, with any additional supporting text anywhere you want it, and you've got huge flexibility there. And no matter how complex it is, you can save it as a preset so it's readily accessible later.

  • Batch Rename causes error with 1000 files

    If I perform a batch rename with  more than 1000 files or more I get an error filled batch rename.
    I may have  6 difference sets of model poses with unique numeric names.  I select all files and rename with model's name and named sequentially with a 3 digit series.  What I get is a mix of the pictures in the sets with names that act like duplicates with a (1) in some of them.
    If I have less than 1000 files I have no problems. 
    Has anyone else experienced this?

    Paul
    Interesting but does not work here.  Tried it on a few test jpeg images.  Have enclosed the screen shot.  Unless I am doing something wrong, always a possibility, it does not list the old name, uses the new name,  and look at the extension.  It adds the sequence number after the extension so it is .jpeg003.  Which won't fly.

  • No batch rename?

    I like to re-arrange photos (i.e. weddings into ceremony, reception, etc.) before renaming. The stacking feature will be excellent for this. Is import the only place in aperature to re-name files other than manually doing it in list view? I am hoping that I am just overlooking this somewhere. If batch re-naming after import, stacking, and rearranging master images is not available, aperture's usefulness is greatly reduced for me. Might as well go back to Bridge and ACR.

    thanks for replying. I am still having a problem though. After sorting (stacking) by image date, time taken, I then manually sort some of the images (groups and formals taken after ceremony with formals before, etc.) In other words, sorting by time taken gets me in the ballpark but then I further re-sort some images the way I want them, some may actually be out of order from time taken. Then, when I batch rename with metadata batch, aperture still renames all files by the date and time and ignores any manual sorting I did. Bridge did not work this way - after manually sorting and getting images in the order I wanted them, the batch rename would sequentially name them in the order I arranged them in. It's all just a new workflow for me, I may eventually figure it out. I really want to like aperture! Unlike some others, I do like the raw conversions I am getting (Canon 5D and 1DMkII)

  • Sedname - Batch rename files using sed

    Renaming files using sed is nothing new, but this script makes the process a little more friendly and adds a few features, including insertion of sequential numbers and a simulation mode.  The output of any find command can also be piped through sedname.
    sedname version 1.0.0
    Batch-renames files using a sed script
    Usage: sedname [OPTIONS] SEDSCRIPT FILE ...
    Usage: find [...] | sedname [OPTIONS] SEDSCRIPT
    Example: sedname 's/\(.*\)\.jpg/\1.jpeg/' *.jpg
    Example: find /mypics | sedname 's/\(.*\)\.jpg/\1.jpeg/'
    OPTIONS:
    --sim simulate only
    --dir rename directories too
    Use #D to insert a number with D digits forming a unique filename
    Example: sedname 's/thisname.*/thatname#3/' *
    ( changes thisname* to thatname001, thatname002, ... )
    Use #0 in replacement name to insert a number if needed
    Example: sedname 's/thisname.*/thatname#0/' *
    ( changes thisname* to thatname, thatname1, thatname2, ... )
    http://igurublog.wordpress.com/download … t-sedname/
    http://aur.archlinux.org/packages.php?ID=37707

    What does it have over zsh's zmv:
    # Remove illegal characters in a fat32 file system. Illegal characters are
    # / : ; * ? " < > |
    # NOTE: ``-Q'' and (D) is to include hidden files.
    $ unwanted='[:;*?\"<>|]'
    $ zmv -Q "(**/)(*$~unwanted*)(D)" '$1${2//$~unwanted/}'
    # Changing part of a filename (i. e. "file-hell.name" -> "file-heaven.name")
    $ zmv '(*)hell(*)' '${1}heaven${2}'
    # or
    $ zmv '*' '$f:s/hell/heaven/'
    # remove round bracket within filenames
    # i. e. foo-(bar).avi -> foo-bar.avi
    $ zmv '*' '${f//[()]/}'
    # serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)
    $ ls *
    1.c asd.foo bla.foo fnord.foo foo.fnord foo.foo
    $ c=1 zmv '*.foo' '$((c++)).foo'
    $ ls *
    1.c 1.foo 2.foo 3.foo 4.foo foo.fnord
    # Rename "file.with.many.dots.txt" by substituting dots (exept for the last
    # one!) with a space
    $ touch {1..20}-file.with.many.dots.txt
    $ zmv '(*.*)(.*)' '${1//./ }$2'
    # Remove the first 4 chars from a filename
    $ zmv -n '*' '$f[5,-1]' # NOTE: The "5" is NOT a mistake in writing!
    # Rename names of all files under the current Dir to lower case, but keep
    # dirnames as-is.
    $ zmv -Qv '(**/)(*)(.D)' '$1${(L)2}'
    # replace all 4th character, which is "1", with "2" and so on
    $ zmv '(???)1(???[1-4].txt)' '${1}2${2}'
    # Remove the first 15 characters from a string
    $ touch 111111111111111{a-z}
    $ zmv '*' '$f[16,-1]'
    # Replace spaces (any number of them) with a single dash in file names
    $ zmv -n '(**/)(* *)' '$1${2//( #-## #| ##)/-}'
    # or - with Bash
    $ find . -depth -name '* *' -exec bash -c '
    > shopt -s extglob
    > file=$1
    > dir=${file%/*}
    > name=${file##*/}
    > newname=${name//*([ -]) *([ -])/-}
    > mv -i -- "$file" "$Dir/$newname"' {} {} \;
    # Clean up file names and remove special characters
    $ zmv -n '(**/)(*)' '$1${2//[^A-Za-z0-9._]/_}'
    # Add *.py to a bunch of python scripts in a directory (some of them end
    # in *.py and give them all a proper extension
    $ zmv -n '(**/)(con*)(#qe,file $REPLY | grep "python script",)' '$1$2.py'
    # lowercase all extensions (i. e. *.JPG) incl. subfolders
    $ zmv '(**/)(*).(#i)jpg' '$1$2.jpg'
    # Or - without Zsh
    $ find Dir -name '*.[jJ][pP][gG]' -print | while read f
    > do
    > case $f in
    > *.jpg) ;
    > *) mv "$f" "${f%.*}.jpg" ;
    > esac
    > done
    # remove leading zeros from file extension
    $ ls
    filename.001 filename.003 filename.005 filename.007 filename.009
    filename.002 filename.004 filename.006 filename.008 filename.010
    $ zmv '(filename.)0##(?*)' '$1$2'
    $ ls
    filename.1 filename.10 filename.2 filename.3 filename.4 filename.5 ..
    # renumber files.
    $ ls *
    foo_10.jpg foo_2.jpg foo_3.jpg foo_4.jpg foo_5.jpg foo_6.jpg ..
    $ zmv -fQ 'foo_(<0->).jpg(.nOn)' 'foo_$(($1 + 1)).jpg'
    $ ls *
    foo_10.jpg foo_11.jpg foo_3.jpg foo_4.jpg foo_5.jpg ...
    # adding leading zeros to a filename (1.jpg -> 001.jpg, ..
    $ zmv '(<1->).jpg' '${(l:3::0:)1}.jpg'
    # See above, but now only files with a filename >= 30 chars
    $ c=1 zmv "${(l:30-4::?:)}*.foo" '$((c++)).foo'
    # Replace spaces in filenames with a underline
    $ zmv '* *' '$f:gs/ /_'
    # Change the suffix from *.sh to *.pl
    $ zmv -W '*.sh' '*.pl'
    # Add a "".txt" extension to all the files within ${HOME}
    # ``-.'' is to only rename regular files or symlinks to regular files,
    # ``D'' is to also rename hidden files (dotfiles))
    $ zmv -Q '/home/**/*(D-.)' '$f.txt'
    # Or to only rename files that don't have an extension:
    $ zmv -Q '/home/**/^?*.*(D-.)' '$f.txt'
    # Recursively change filenames with characters ? [ ] / = + < > ; : " , - *
    $ chars='[][?=+<>;",*-]'
    $ zmv '(**/)(*)' '$1${2//$~chars/%}'
    # Removing single quote from filenames (recursively)
    $ zmv -Q "(**/)(*'*)(D)" "\$1\${2//'/}"
    # When a new file arrives (named file.txt) rename all files in order to
    # get (e. g. file119.txt becomes file120.txt, file118.txt becomes
    # file119.txt and so on ending with file.txt becoming file1.txt
    $ zmv -fQ 'file([0-9]##).txt(On)' 'file$(($1 + 1)).txt'
    # lowercase/uppercase all files/directories
    $ zmv '(*)' '${(L)1}' # lowercase
    $ zmv '(*)' '${(U)1}' # uppercase
    # Remove the suffix *.c from all C-Files
    $ zmv '(*).c' '$1'
    # Uppercase only the first letter of all *.mp3 - files
    $ zmv '([a-z])(*).mp3' '${(C)1}$2.mp3'
    # Copy the target `README' in same directory as each `Makefile'
    $ zmv -C '(**/)Makefile' '${1}README'
    # Removing single quote from filenames (recursively)
    $ zmv -Q "(**/)(*'*)(D)" "\$1\${2//'/}"
    # Rename pic1.jpg, pic2.jpg, .. to pic0001.jpg, pic0002.jpg, ..
    $ zmv 'pic(*).jpg' 'pic${(l:4::0:)1}.jpg'
    $ zmv '(**/)pic(*).jpg' '$1/pic${(l:4::0:)2}.jpg' # recursively
    (from zsh-lovers)
    Edit: tried it now, and had to remove this silly block to make it let me use alternate delimiters:
    if [ "${sedscript:0:2}" != "s/" ]; then
    echo "Invalid sed script: $sedscript" > /dev/stderr
    exit 1
    fi
    Last edited by JohannesSM64 (2010-05-31 15:29:44)

Maybe you are looking for

  • Fields missing in Support Message from CRMD_ORDER

    Hi All, when we create a Support Message from transaction notif_create, there some fields like component, project and solution but when we create the same support message from transaction crmd_order, i could not find those fields. Please suggest Rega

  • How do I move a group of tabs before closing a window?

    I recently lost all my custom settings on Firefox after an aggressive tech support person "cleaned" my browser settings. When this happened, I lost the ability to move my open tabs to a new group before closing the window they were in. Previously, wh

  • Problem with a TV episode

    ok so I Downloaded Heroes Episode "Cold Wars" and it stops 10 mins before the end? i Reported the problem but all i got was an email back saying you cant have a refund?? I don't want a refund i want to redownload the episode i payed for as its not co

  • Dynamic Title without JS in secondary pages

    Hi All, I am working on SSXA application with UCM 11g via Jdev 11g. We have more than 2,000 secondary pages which represent different users. The secondary page comprise of HEADER, BODY and FOOTER. I have title tag in header which displays static text

  • Why the VI starts breaking when I enter property nodes?

    Hi, I'm a student in engeneering and need to do a work in labview. It's a Signal generator with in-built osciloscope. The VI was working fine ultil I add the property nodes to change wavegraph scales and the VI start breaking with them. Can anyone se