I want to replace spaces (i.e.,  ) or new lines (i.e., carriage return) with underscores in a special case - when they occur between two specific strings.I have html pages and I want to replace the blank spaces and new lines with underscores when they occur between  two specific strings.Example:lots of text...page_5.html months agoThis is the password: 6743412 <http://website.com etc...more text...I want to to go from above to below:lots of text...page_5.html months ago__This_is_the_password:_6743412_<http://website.com etc...more text...Basically, I want to do the replacement only between the strings ago and <httpIt is repetitive html so if I can get this to work it would be very helpful and easy to extract the modified text later.Something using sed or awk would be best for me.
Replacing spaces (i.e.,  ) or new lines (i.e., carriage return) with underscores - special case
text processing