The data looks like this :
There is stuff here (word, word number phrases)
(word number anything, word phrases), even more
...
There is a l
Here's a version for awk that uses the parentheses as record separators:
awk -v RS='[()]' 'NR%2 == 0 {sub(/,/,":")} {printf "%s%s", $0, RT}' file
The stuff between parentheses will be every even-numbered record. The RT
variable holds the character that matched the RS
pattern for this record.
Note that this only replace the first comma of the parenthesized text. If you want to replace all, use gsub
in place of sub