Re: upper/lower case

"[email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
#Greetings
#If names in 4th column and delimiter is "@" then somethis like 
 # Please use with --regexp-extended options
 #Work only with strings, that have at least 4 columns ( 3 delimiters)

/^([^@]*@){3}.*/{
 # Put pattern to hold
 h
 # Extract fouth column
 s/^([^@]*@){3}([^@]+)(@[^@]*)*/\2/
 # Turn all letter in lowercase, except first 
 s/[A-Z]+/\L\u\0/gi
# Add to pattern space 
 H
 x
 # Replace fourth column with changed data
 s/^(([^@]*@){3})[^@]*(@[^@]*)*\n(.*)$/\1\4\3/
 :a
}
 

 

#Best regards

[Non-text portions of this message have been removed]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.