Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Renaming files with a list

  1. #11
    Join Date
    Jun 2016
    Beans
    2,839
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Renaming files with a list

    Would qmv (from renameutils package) help here? Especially if your list of desired filenames is in the same order that qmv displays the original filenames?
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  2. #12
    Join Date
    Jun 2009
    Beans
    101

    Re: Renaming files with a list

    with all due respect to what was said so far (and I hardly understand any), it took me less than a minute to do thsi:

    171Culzean Castle 01, Scotland.jpeg

    218Culzean Castle 02, Scotland.jpeg

    503Culzean Castle 03, Scotland.jpeg


    Desmond Castle, Ireland.jpeg

    Dolbadarn Castle, Wales.jpeg
    Donnington Castle, England.jpeg

    Doonagore Tower 1, Ireland.jpeg

    Doonagore Tower 2, Ireland.jpeg

    Doonagore Tower 3, Ireland.jpeg
    Doonagore Tower 4, Ireland.jpeg

    And these are the new names:

    171Culzean Castle 01, Scotland.jpeg

    218Culzean Castle 02, Scotland.jpeg

    503Culzean Castle 03, Scotland.jpeg


    and it will take me another minute to copy the desired names and place them on the highlighted

    "undesirable " names (one by one).


  3. #13
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,708

    Re: Renaming files with a list

    Yes, sometimes just doing things by hand can be the quickest. But there are apparently "a lot" of files to rename. Judging by the list shown, I would guess one to two hundred.
    And finding a solution to that was easily as interesting as doing another sudoku puzzle on a Sunday morning.

  4. #14
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Renaming files with a list

    Just saw that halogen2 made the suggestion below, but since I'd already typed it, perhaps from a different angle, it will add to understand the tool?

    qmv will use any editor you like and has 2 columns, A, B.
    A is the current filename.
    B is the desired filename.
    When the text file has all the new names you want in column B, quit/save and the rename will happen. Any temporary collisions are handled, but if 2 files get the same name, it will not rename any of them until that is fixed. Use whatever editor you like. With vim, you can easily merge the file with the new names into column B.

    This will probably save a step, since there isn't really a pattern to the new filenames.

    When it comes to scripting this stuff, filenames with spaces and other non-alphanumeric characters, often cause scripting issues. You'll need to be extremely cautious with how you parse any inputs.

    I do both scripted renaming and use qmv, almost daily for many thousands of files since I started.

  5. #15
    Join Date
    Dec 2012
    Beans
    9

    Re: Renaming files with a list

    This does look promising. I'm going on vacation next week and may not have time to try it before I leave. I have used computers for more than forty years, all sorts, many systems. I'm not afraid of trying to do stuff in the terminal, but I'm not overly knowledgeable about some of the commands and how to do things. I tend to learn what I need, when I need. This particular need has never come up before.

    The "logic" of what I want to do is simple. I like pictures of castles. I have a large collection of such pictures. The list is alphabetical of course. What I want to do it use these pictures for a slide show, without getting twenty pictures of the same castle before seeing the next one. That's what the numbers are for, to re-organize the pictures.

  6. #16
    Join Date
    Dec 2012
    Beans
    9

    Re: Renaming files with a list

    This looks good, too. I think. As I said above, I'm not well-versed in command line work. I don't actually understand anything you wrote, but I'll try it. Probably after my vacation. Thank you for your help.

  7. #17
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Renaming files with a list

    The "logic" of what I want to do is simple. I like pictures of castles. I have a large collection of such pictures. The list is alphabetical of course. What I want to do it use these pictures for a slide show, without getting twenty pictures of the same castle before seeing the next one. That's what the numbers are for, to re-organize the pictures.


    Now that you have specified requirements in full, one suggestion is that you use Zettlr as your editor (markdown). You can embed links to castles wthin your markdown code. that is each slide. You can navigate in two directions. Left <-> Right arrows, and in fragments up and down. So a slide might relate to a castle but "fragments" (north south navigation) can hold different scenes with child notes. A two directional slide show. Embedding images is explained in Zettlr manual.

    The powerful feature in Zettlr which migh help you is export to Reveal.js. This gives the slideshow you want.

  8. #18
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Renaming files with a list

    I do something similar with my photos, but rather than trying to organize them too much with filenames, I keep them in order by leaving the numeric sequence alone. I will add metadata to the EXIF fields with different locations and keywords to help find them later.

    I have very few rules about photo organization. #1 is that I'll never trust any external tool with extra information. I've been burned. I want the filename and the embedded metadata to contain everything. That metadata can be searched later for keywords, so if any specific location is important, I'll use the "Sub-Location" EXIF field for that. I also try to have the GPS coordinates correct as possible. For example,

    Code:
    165-Hotel_Simple_Patagonia_Views-best.jpg
    Create Date                     : 2017:11:25 16:52:34
    City                            : Puerto Nagales
    Sub-location                    : Condor Views
    Province-State                  : 
    Country-Primary Location Name   : Chile
    That specific image doesn't have GPS, since I wasn't using a GPS to track at the time, but the filename has the location, which is at GPS: -51.695356, -72.527458
    The Plus Code is : 8F3F+W5 Natales, Chile

    Anyway, there are map tools that can show all the images with embedded GPS coordinates that are nearby. I use this with Nextcloud Maps/Photos to see locations on a map, then click on a specific icon to see the full photo and all EXIF for it.

  9. #19
    Join Date
    Dec 2014
    Beans
    2,604

    Re: Renaming files with a list

    Most slide show programs can work of a list of files to show. For example 'feh' has an option '-f ' which will take a file that contains a list of image files one file per line which it will then proceed to show. No need to do any renaming. Even better, you can start feh with an empty or non existing playlist but give it the images that are candidates for the playlist on the command line (e.g. 'feh -f emptyplaylist.txt *.jpg') and then go through the slideshow and just hit the 'del'-key on any image you don't want in the slide show and it will automatically save the list when you exit.

    Holger

  10. #20
    Join Date
    Dec 2012
    Beans
    9

    Re: Renaming files with a list

    Thank you very much for your suggestion. It worked almost perfectly. The first time I tried it, it failed because the command script put an extra zero in the numbers of the original files, so it couldn't find them. I fixed that. When I ran it again, it changed almost all the filenames. I still have about a dozen I'll have to do manually, but that's a huge improvement. Thanks again.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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