I have a line of text like:
value,value,,,value,value
I want the two empty values to be replaced with a different value. Something like:
value,value,hello,hello,value,value
I'm currently trying something like:
sed -e 's/^,/hello,/' -e 's/,$/,hello/' -e 's/,,/,hello,/g'
That catches blank values at the beginning, end and the middle. BUT, it doesn't catch two consecutive blank values in a row. How can I update the regular expression patterns so that an indefinite number of consecutive blank values can appear in the middle?
man sedsays I can use --regexp-extended: use extended regular expressions in the script.sedeither. Any commonly available tool will do (i.e. installed by default on most distros).