Yes, the above will work like a charm.
set f [string toupper $f]
f is a list or string. If you want to work with files, as usual, read from a file and write.
If you just want to use regsub, try
set f "this is a line" regsub -all {.*} $f {[string toupper {&}]} f set f [subst -nobackslashes -novariables $f]
now your content in f is uppercase.
note: it looks long, but is useful when selecting only a specific text, which should be top or bottom.
Thanks,
source share