Quantcast
Channel: How to recursively replace characters with sed? - Super User
Browsing all 5 articles
Browse latest View live

Answer by Digital Trauma for How to recursively replace characters with sed?

The looping answer is the general way to do what you are asking.However in the case of your data, assuming you are using GNU you can simply do:sed 's/\B/o/g'The \b and \B options are regex...

View Article



Answer by Kamil Maciorowski for How to recursively replace characters with sed?

In this particular case look-ahead or look-behind would be useful. I think GNU sed doesn't support these. With perl:perl -ne 's/X(?=X)/Xo/g; print;'You could also use lookbehind and lookahead...

View Article

Answer by Ishan Madhusanka for How to recursively replace characters with sed?

I checked if there is any sort of a flag to make this happen.Even if that behavior was there it is going to be highly resource consuming. However, in this particular use case, it is possible to have...

View Article

Answer by Gohu for How to recursively replace characters with sed?

You can do:> echo XXXX | sed -e ':loop' -e 's/XX/XoX/g' -e 't loop'XoXoXoXWith:-e ':loop' : Create a "loop" label-e 't loop' : Jump to the "loop" label if previous substitution was successful

View Article

How to recursively replace characters with sed?

Is it possible to replace occurrences of a character sequence recursively without iterating over the same sequence again?By performing a sed as in the following scenarios I can get the mentioned...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images