Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set text to lowercase...

Status
Not open for further replies.

flavioweb

Technical User
Nov 28, 2011
7
IT
...but in one line after a ; and if ; is not first line char. for example:
LDA COLORS ; DO A COLOR
how to set "DO A COLOR" to lowercase?
 
Hi

Code:
awk -F ';' -vOFS=';' '[navy]$2[/navy][teal]{[/teal][navy]$2[/navy][teal]=[/teal][b]tolower[/b][teal]([/teal][navy]$2[/navy][teal])[/teal][teal]}[/teal][purple]1[/purple]' /input/file


Feherke.
[link feherke.github.com/][/url]
 
thanks.
i can test it later...
just one thing, because i want to be sure, if there is a text after ; as first line char, this text is converted to lowercase?
because i need to avoid this.
just convert if ; isn't first line char.
thanks again :)
 
I'd try this:
Code:
awk -F ';' -vOFS=';' '$2[!] && substr($0,1,1)!=";"[/!]{$2=tolower($2)}1' /input/file

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Code:
awk -F ';' -vOFS=';' '$2 && substr($0,1,1)!=";"{$2=tolower($2)}1' /input/file
This one worked as well.

Thanks a lot !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top