Nov 21, 2007 #1 michciub Programmer Nov 21, 2007 4 PL How write a script which will change the lower letter to big letter and big letter to lower letter ?
Nov 21, 2007 Thread starter #2 michciub Programmer Nov 21, 2007 4 PL AWK in Windows Upvote 0 Downvote
Nov 21, 2007 1 #3 vgersh99 Programmer Jul 27, 2000 2,146 US I'd suggest by start reading the awk manual. I might be way off on the matter though.... vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
I'd suggest by start reading the awk manual. I might be way off on the matter though.... vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Nov 21, 2007 Thread starter #4 michciub Programmer Nov 21, 2007 4 PL Is this possible to do it without function, or it's only one way to solve this problem??? (just use regular expression) function switchcase(s , n, a, rv, i, c) { n = split(s, a, //) rv = "" for (i = 1; i <= n; ++i) { c = a if (c ~ /[a-z]/) rv = rv toupper(c) else rv = rv tolower(c) } return rv } { print switchcase($0) } Upvote 0 Downvote
Is this possible to do it without function, or it's only one way to solve this problem??? (just use regular expression) function switchcase(s , n, a, rv, i, c) { n = split(s, a, //) rv = "" for (i = 1; i <= n; ++i) { c = a if (c ~ /[a-z]/) rv = rv toupper(c) else rv = rv tolower(c) } return rv } { print switchcase($0) }
Nov 21, 2007 #5 vgersh99 Programmer Jul 27, 2000 2,146 US something like this: Code: { s="" for(i=1; i<=length; i++) { c=substr($0, i, 1) s = s ((c ~ /[a-z]/) ? toupper(c) : tolower(c)) } print s } vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
something like this: Code: { s="" for(i=1; i<=length; i++) { c=substr($0, i, 1) s = s ((c ~ /[a-z]/) ? toupper(c) : tolower(c)) } print s } vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Nov 21, 2007 Thread starter #6 michciub Programmer Nov 21, 2007 4 PL THANKS A LOT !!! Upvote 0 Downvote