From: Stroller <stroller@stellar.eclipse.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Changing names of LOTS of files, adding to them actually.
Date: Fri, 2 Dec 2011 10:50:37 +0000 [thread overview]
Message-ID: <39EFFC06-DEAF-4831-979C-28B847A29383@stellar.eclipse.co.uk> (raw)
In-Reply-To: <4ED759FC.6060801@gmail.com>
On 1 December 2011, at 10:42, Dale wrote:
>> ...
>> sys-apps/renameutils should be installed on every system, IMO, and aliased thus in your .bashrc:
>>
>> alias qmv="qmv -f do"
>> alias qcp="qcp -f do"
>>
>> Set $EDITOR to vi, and renaming TV shows becomes quick and easy.
>
> vi? O_O Would nano not work? I got stuck in vi once. I felt like I was in Hotel California. :/ Got that tune in your head now huh? lol
>
> I'm going to see what else is available too. I bet since Krename is installed, rename is installed too. I'm sure Krename is just a GUI front end to something already on here.
nano would work.
When you use renameutils in --format=destination-only (`-f do`) mode, you just get a list of current file names in your text editor. You change them to the new names you desire and when you save the text file (and exit) the rename is completed. If you make such an error that you don't want the changes to apply you exit the text editor without saving.
The reason that vi or vim is recommendation-worthy is that you can do advanced search and replace and save macro functions for (for example) fixing capitalisation [1] or changing underscores or periods to spaces.
It would be easy, for example, to save a function in your .vimrc to change every instance of SxxEyy (e.g. S01E13) to "Season xx - Episode yy".
Sure, you can do all this with the other tools suggested by others, but each time you're going to have to use the mouse to select the "from" box in the GUI, then type "_", then mouse to the "to" box and type " " and so on. You're going to be performing the same handful of identical functions each time. In vim you can save these and activate them with the f2, f3, f4 keys.
An advantage of using the search and replace within a text editor is that you'll be able to see these kinds of automatable filename changes *alongside* edits that you'll want to make manually, and you can see the results immediately. So if you misdo the search and replace you can just use vim's undo command, and then redo the replace with the same starting point you used before. This is clearly much better than realising that "whups! i've renamed all these files wrongly now" and having to work out the correct regrex based on their new filenames.
Finally, when you're dealing with whole series of TV shows, the ability to select by column, or to insert the same text at the same place on several different lines should not be underestimated.
Stroller.
[1] http://vim.wikia.com/wiki/Switching_case_of_characters#Twiddle_case
next prev parent reply other threads:[~2011-12-02 10:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 1:49 [gentoo-user] Changing names of LOTS of files, adding to them actually Dale
2011-12-01 2:18 ` Frank Steinmetzger
2011-12-01 2:46 ` Dale
2011-12-01 2:19 ` Francisco Ares
2011-12-01 2:23 ` Francisco Ares
2011-12-01 2:22 ` Pandu Poluan
2011-12-01 2:29 ` Pandu Poluan
2011-12-01 2:22 ` bill.longman
2011-12-01 3:23 ` Frank Steinmetzger
2011-12-01 4:18 ` Dale
2011-12-01 8:53 ` Neil Bothwick
2011-12-01 9:34 ` Stroller
2011-12-01 10:42 ` Dale
2011-12-01 15:29 ` Frank Steinmetzger
2011-12-02 17:33 ` James Broadhead
2011-12-02 10:50 ` Stroller [this message]
2011-12-02 15:43 ` Frank Steinmetzger
2011-12-01 10:55 ` Helmut Jarausch
2011-12-01 13:22 ` James Broadhead
2011-12-01 13:51 ` Paul Hartman
2011-12-02 10:21 ` Stroller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39EFFC06-DEAF-4831-979C-28B847A29383@stellar.eclipse.co.uk \
--to=stroller@stellar.eclipse.co.uk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox