I recently purchased, ripped, and almost finished transcoding the entire series of Friends. I’m currently in the process of converting subtitles with Subtitle Edit. I’d like to save myself a bit of work by taking the last 13-14 characters off the ends of the file names.

For example, I’d like to take track13[spa] off of the following filename: 03x10 - The One Where Rachel Quits_track13_[spa].sup

Or is this not possible with Nautilus?

  • Ictinus
    link
    English
    2
    edit-2
    1 year ago

    Assuming all but the number is the same in all file names, try this in a folder with a test file first…

    rename 's/_track\d*_\[spa\]//' *

    • @MrGeekmanOP
      link
      English
      2
      edit-2
      1 year ago

      Thank you! I noodled around with that in a GUI program called GPRename and found a workable solution I just had to modify yours a bit to make it work there. Here’s the finished solution, at least when using a graphical program like GPRename: _track\d*_\[eng\] *

  • @zikk_transport2
    link
    English
    11 year ago

    Try asking chatgpt to write such bash script. Of you are not good at bash - ask to tell how to execute it too.

  • @oceanus_ursus
    link
    English
    11 year ago

    This is something I’d probably do with a shell script. You can do it in a few intermediate stages. I’d start with putting together a script to dump the filenames to a text file and then some sed and awk to process that down to the final names. You could basically write a script to generate a script that you could inspect to see if it was correct before running it.