Find and replace (insert Return character)

Discussion in 'XML' started by ©®, Feb 6, 2008.

  1. ©®

    ©® Guest

    I have a whole lot of entries listed as:
    <image><filename>
    and would like to search and replace so the end result is so:
    <image>
    <filename>
    i.e. there is a return/enter after <image>

    I am using Notepad++). I highlighted text on two lines and when I tried
    Search and Replace (Ctrl+H), I get the "square" which represents
    Return/Enter in the search box but I cannot copy it to the replace box.
    Anyone know how I can "type" the return character in a text editor?
    Thanks.
    ©®, Feb 6, 2008
    #1
    1. Advertising

  2. ©® wrote:
    > I have a whole lot of entries listed as:
    > <image><filename>
    > and would like to search and replace so the end result is so:
    > <image>
    > <filename>
    > i.e. there is a return/enter after <image>
    >
    > I am using Notepad++). I highlighted text on two lines and when I tried
    > Search and Replace (Ctrl+H), I get the "square" which represents
    > Return/Enter in the search box but I cannot copy it to the replace box.
    > Anyone know how I can "type" the return character in a text editor?


    With jEdit there is a regular expression option in the search/replace
    dialog and then \n inserts a line break. Check whether Notepad++ allows
    that too.




    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Feb 6, 2008
    #2
    1. Advertising

  3. If you're using a text-based tool to edit the XML, the fact that it's
    XML is sorta irrelevant; that's a question of what your particular tool
    can do.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
    Joseph Kesselman, Feb 6, 2008
    #3
  4. ©®

    ©® Guest

    I got an answer in the Notepad++ forum:

    In the replace area, type

    \1\r\n\2 -- \1 is the first group, \r\n is a carriage return and a new
    line, \2 is the second group.

    Click Replace All.
    ©®, Feb 6, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greenhorn
    Replies:
    15
    Views:
    792
    Keith Thompson
    Mar 6, 2005
  2. herman
    Replies:
    5
    Views:
    7,573
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=
    Aug 30, 2007
  3. Wybo Dekker
    Replies:
    1
    Views:
    336
    Yukihiro Matsumoto
    Nov 15, 2005
  4. vdvorkin
    Replies:
    0
    Views:
    385
    vdvorkin
    Feb 10, 2011
  5. vdvorkin
    Replies:
    3
    Views:
    789
    vdvorkin
    Feb 14, 2011
Loading...

Share This Page