Menu ▾ ▴

Search Replace.

2009-09-01
2012-11-14
  • Lars Schmidt

    Lars Schmidt - 2009-09-01

    Hello.

    Im trying to make a search replace it looks something like this. :

    table ca_contact
    zzid contact_type
    EmplAD06044;2307
    EmplAD00816;2307
    EmplMP07927;2307
    EmplMP08023;2307
    EmplMP07901;2307
    EmplMP09791;2307
    EmplAD00225;2307
    EmplAD01068;2307
    EmplAD01443;2307

    I need to search for \n (new line) so far so good no worries here..
    i need to replace it with "}\n{"
    here is the problem
    table ca_contact
    "}
    {"zzid contact_type
    "}
    {"EmplAD06044;2307
    "}
    {"EmplAD00816;2307
    "}
    {"EmplMP07927;2307
    "}
    {"EmplMP08023;2307
    "}

    It almost do as intented, but a line should look like this.

    {"EmplMP08023;2307"}

    With no line brake.

    how do i make it look like that. ?

     
    • cchris

      cchris - 2009-09-01

      Either use a scripting language instead, like sed or awk, or simply adjust your search and replace results manually. I'd recommend the latter, because the adjustments concern the first and last line, no matter how long the txet is.

      CChis

       
    • Glenn

      Glenn - 2009-09-01

      It works for me if I search for
      \r\n
      and replace with
      "}\r\n{"
      Then all you have to do is manually edit the first and last lines.  Notepad++ has a habit of highlighting the first word next to the cursor when I select replace from the menu so you have to click the "Find Next" button then you can click the "Replace All".  I have the search mode set to "Extended.."

       
    • Lars Schmidt

      Lars Schmidt - 2009-09-01

      Thanks alot, that worked like a charm.