Re: [SLUG] I wish to lowercase a character in a sed script

2005-03-16 Thread Angus Lees
At Mon, 14 Mar 2005 17:57:08 +1100, Michael Lake wrote: > Suggested a perl script: > cat titles.html | perl -ne 'm/\.html">([^,]{1,}),/; $name=lc($1); $_ > =~ s/\.html">/\.html#$name">/; print "$_";' equivalent to: perl -pe 's/\.html">([^,]+),/.html#\L$1\E">/' < titles.html (sorry, should have p

Re: [SLUG] I wish to lowercase a character in a sed script

2005-03-13 Thread Michael Lake
Thank you all Here is a summary of how it all went. 1. Roger Barnes: Can you not simplay add \l (force next element to lowercase) in your replacement? Yes - its works fine. My version of sed is the GNU one 4.1.2. The /l works perfectly. Its not mentioned in the man pages for sed but it is mention

Re: [SLUG] I wish to lowercase a character in a sed script

2005-03-13 Thread SEKINE Tatsuo
From: "Roger Barnes" <[EMAIL PROTECTED]> Date: Mon, 14 Mar 2005 08:35:23 +1100 > Can you not simplay add \l (force next element to lowercase) in your > replacement? > > Eg (untested) ... > > cat titles.html | sed 's/"col1"> href="\(.*\)\.html">\([A-Z][a-z]*\),/"col1">\2,/' > > test.html It ma

RE: [SLUG] I wish to lowercase a character in a sed script

2005-03-13 Thread Roger Barnes
> #!/bin/bash > # Agrawal, B.M. > and Kumar, Virendra # href="111_12.html#Agrawal">Agrawal, B.M. and Kumar, > Virendra cat titles.html | sed 's/"col1"> href="\(.*\)\.html">\([A-Z][a-z]*\),/"col1"> href="\1.html#\2">\2,/' > test.html > > How can I lower case the anchors i.e. #Agrawal to #agrawal

Re: [SLUG] I wish to lowercase a character in a sed script

2005-03-13 Thread SEKINE Tatsuo
Hi From: Daniel Bush <[EMAIL PROTECTED]> Date: Sun, 13 Mar 2005 22:35:48 +1100 >> #!/bin/bash >> # Agrawal, B.M. and Kumar, >> Virendra >> # Agrawal, B.M. and >> Kumar, Virendra >> cat titles.html | sed 's/"col1">> href="\(.*\)\.html">\([A-Z][a-z]*\),/"col1">\2,/' >> > test.html >> >> How can

Re: [SLUG] I wish to lowercase a character in a sed script

2005-03-13 Thread Daniel Bush
Michael Lake wrote: Hi all I have a titles.html file from someone that has several hundred authors listed in a table. e.g. Agrawal, B.M. and Kumar, Virendra At present the above link goes to the top of that file (the contents of that journal issue) but I want the link to directly go to the auth