[ale] help with sed and regex
Leam Hall
leamhall at gmail.com
Tue Jul 26 10:58:59 EDT 2016
On 07/26/16 10:43, Chuck Payne wrote:
> Guys,
>
> I am still weak on regex. So I have a question. I got a list of
> directories that I need to add _ too. It should be as the first two
> character are lower for the state and then the Client name is a Upper
> Case character. What is the best way to do that?
Chuck, what language? Can you provide an example, I'm not seeing the
format? Do you mean something like:
scLeam -> sc_Leam
####
[leam at shaphan tmp]$ cat forchuck
scLeam
gaChuck
[leam at shaphan tmp]$ for line in `cat forchuck `;
do
echo $line | sed 's/\([a-z][a-z]\)\([a-zA-Z]*\)/\1_\2/'
done
More information about the Ale
mailing list