logo       

Re: One more on sort order...: msg#00071

hardware.voyetra.audiotron

Subject: Re: One more on sort order...

Well, why do it in an editor? :-)

Provided your sed knows about extended regexps ("egrep(1)-style
regexps"), i.e. it has the "-E" switch or equivalent, you can
use this:

mv atrontc.vtc atrontc.bak && \
sed -E \
-e 's/^(TALB|TPE1|TIT2)=([Aa]n?|[Tt]he) (.*)$/\1=\3, \2/' \
< atrontc.bak \
> atrontc.vtc

If you must use the vi editor, you'll need one that likewise
knows about extended regexps. With "nvi" (which is the default
vi in NetBSD, possibly other modern BSD's as well) you can get
egrep(1)-style regular expressions with

:set extended

Older vi's only do simpler regular expressions, most notably the
pipe character is not available to indicate alternatives.

With "set extended" you could use this in vi command mode:

:%s/^(TALB|TPE1|TIT2)=([Aa]n?|[Tt]he) (.*)$/\1=\3, \2/

Regards,
+ Kim


| From: Mike Scott <michaelt@xxxxxxxxx>
| Date: Mon, 08 Mar 2004 12:00:58 -0500
|
| If your VI has this kind of regular expression facility, you probably can
| do this with it. Otherwise, like the other guy said, you can learn some
| Perl and modify iToc to do it. 8^)

-----------------------------------------------------------
List archives: http://maillist.voyetra.com/audiotron.html
You may leave the list at any time by sending an e-mail
to LISTSERV@xxxxxxxxxxxxxxxxxxxx with only the words
"SIGNOFF AUDIOTRON" in the body of the e-mail.
Separate Message Board available at:
http://www.turtle-beach.com/wb/messageboard.htm
-----------------------------------------------------------



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise