[Techtalk] script to change uppercase to title case in OFX/QFX
John Sturdy
jcg.sturdy at gmail.com
Wed Nov 30 10:44:42 UTC 2011
On Wed, Nov 30, 2011 at 10:22 AM, Miriam English <mim at miriam-english.org> wrote:
> Amazing how you can look at something again and see it quite differently.
>
> sed '/<NAME>\|<MEMO>/s/\([A-Z]*\)\( \|$\)/\L\u\1\2/g'
>
> work only on lines containing "<NAME>" or "<MEMO>"
> do a substitution
> looking for for strings of capital letters ending in
> either a space or the end of line
> and change to
> the string translated to all lowercase,
> but with the first letter uppercase
>
> Wow!
Yes, definitely Wow for that one...
It's one I'd have solved in emacs (not as neatly as the above), even
firing up a batch-mode emacs if necessary --- see
http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-22.html#replace
for how to do this and more.
__John
More information about the Techtalk
mailing list