8 Replies Latest reply on May 13, 2015 4:19 PM by Obi-wan Kenobi

    find/replace every other hard return with a soft return

    Ken.Charity

      I have a document that all hard returns. I need to convert every other hard return to a soft return, fortunately the hard return is after a ZIP code.

       

      I currently have in grep find field: \d{5}\r

       

      This will find/select 5 digits in a row followed by the hard return. Awesome!

       

      But...there is always one right?...

      The whole 5 digits and hard return are selected, so when I try to replace the hard return with a \n it wipes out the digits with it. Not awesome.

      So is there a way for grep to put back the 5 digits it selects and place a soft return after it? or is there a way to just select the hard return after the 5 digits?

       

      Any other solutions that you might think will work I am willing to try too.