will do the substitution and leave a backup file named yourfile.txt.bakshell$ perl -pi.bak -le 's/(?<=[^n])n|n(?=[^n])/^/ig' yourfile.txt
UPDATE: it will not work, because your file has newlines (somehow I missed it). Try this instead:
perl -pi.bak -0377 -e 's/n([n\n]*)n/^$1^/ig' yourfile.txt
In reply to Re^3: replace fist and last occurrences of N
by massa
in thread replace fist and last occurrences of N
by ini2005
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |