Is there a way to add an "enter" as part of a replace command?



  • I have a wikitable that I’m compiling and I’ve got each row set as something like

    |-|4 |Destroyer Kamikaze Class |37.5 |102.6 |9.1 |23.2 |2.9 |1398 |100

    I’d like to replace each - sequence with a

    |

    But I can’t seem to figure out how to format the replace



  • Hello @stephen-knapp and All,

    So, if I understood you, clearly, you have lines like :

    |-|4 |Destroyer Kamikaze Class |37.5 |102.6 |9.1 |23.2 |2.9 |1398 |100
    

    and you expect this resulting text :

    |-
    |4 |Destroyer Kamikaze Class |37.5 |102.6 |9.1 |23.2 |2.9 |1398 |100
    

    Am I right about it ?

    Best Regards

    guy038



  • @Stephen-Knapp

    To answer the direct question, which was:

    Is there a way to add an "enter" as part of a replace command?

    The answer is yes, use Regular Expression for the Search mode, and use the sequence \r\n in the Replace with box, potentially along with other text.



  • Hi, @stephen-knapp, @alan-kilborn and All,

    If I presume that my guess was correct, here is the regex S/R :

    • SEARCH ^\|-

    • REPLACE $0\n in an Unix file    OR    $0\r\n in a Windows file

    • Options Wrap around and Regular expression selected

    Best Regards,

    guy038



  • or: Extended
    |-
    |-\r\n


Log in to reply