I need to add a character in the n'th position (in this case 2nd) of a matching string.
For example, in a file text.txt I would like to add an N before the string and after the " only in the strings that contain blah
text.txt:
"1blah8","na","8blah4"
"2blah5","na","10blah4"
"5blah5","na","1blah234"
I want to get a text2.txt:
"Ν1blah8","na","Ν8blah4"
"Ν2blah5","na","Ν10blah4"
"Ν5blah5","na","Ν1blah234"
I have tried sed 's/.*blah.*/N&/' text.txt > text2.txt
but I get the N before the " and only in the first found string of each line.