Re: [SLUG] text processing

From: Eben King (eben01@verizon.net)
Date: Wed Sep 17 2008 - 20:52:20 EDT


On Wed, 17 Sep 2008, Paul M Foster wrote:

> On Wed, Sep 17, 2008 at 01:20:48PM -0400, Eben King wrote:
>
>> Adding a _capital_ subdirectory is easy enough:
>>
>> :^\/s@/mp3/\(.\)@/mp3/\1/\1
>>
>> (assuming that doesn't do something disallowed in vim)
>>
>> But how do I make the subdirectory lower-case? Or is it easier to make a
>> capital soft link to each subdirectory, do that, then delete the link?
>
> I'm inclined to think you'd have to one of these for each letter of the
> alphabet.

Yes, that's correct. Big sites do it with home directories.

> Like:
>
> :%s/home\/mp3\/A/home\/mp3\/a\/A/g
>
> (Excuse me, as I'm not a whiz at Vim regexps). What you're doing is
> substituting
>
> home/mp3/A
>
> with
>
> home/mp3/a/A

Yes, in the case of Aphex_Twin and Abbot_+_Costello and all those "A"
groups. But for the rest, would I have to do something similar 26 times?
Or is there a regexp form that means "insert lowercase(#1) at #2"?

/home/eben/mp3/_/_...
                2 1

-- 
-eben    QebWenE01R@vTerYizUonI.nOetP    http://royalty.mine.nu:81
SAGITTARIUS:  All your friends are laughing behind your back... kill
them.  Take down all those naked pictures of Ernest Borgnine you've
got hanging in your den.  -- Weird Al, _Your Horoscope for Today_
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:57:58 EDT