Use can try a sed based approach like below. However, this will only work for straight-forward search/replace patterns. If you think your code base may have more complex index expressions, e.g. something like vector.at( foo().at(bar()) )
then this approach will get complex. It may introduce subtle and unwanted code changes -- ensure to diff the files before and after running the sed !
if had a file (code.cc) with line like this:
vector.at(xx) ; vector.at(YY) ;
vector.at( i - j) ; vector.at(KKK - _LLL) ;
doing:
cat file.cc | sed -e 's!.at(\([^)]*\))![\1]!g'
gives
vector[xx] ; vector[YY] ;
vector[ i - j] ; vector[KKK - _LLL] ;
Note, this regexp will not work for more complex lookups, eg, vector.at( foo() )