Copy column

Eric
2009-06-30
2012-11-13
  • Eric
    Eric
    2009-06-30

    Hi,
    I'm very new to notepad++ so I apologize if my question make no sense.

    I have a list like this:
    c=
    fd=
    b=

    and I would like to make it:
    c=c
    fd=fd
    b=b

    (copy values before the sign '=' and paste them after the sign '=')
    It is a very long list so I don't want to do it line by line.

    Can anyone advise?

    Thanks,
    Eric.

     
    • Eric
      Eric
      2009-06-30

      Perfect.

      Thank you so much.

       
    • Fool4UAnyway
      Fool4UAnyway
      2009-06-30

      Use either the Ctrl+F / Ctrl+H Find/Replace dialog or the Ctrl+R Text FX Advanced Find/Replace dialog.

      Check regular expression mode.

      In the Find field, enter:
      ^([^=]+)=$

      In the Replace field, enter:
      \1=\1

      Replace all occurrences.

      ^ ____ Search for/from the start of each line
      [^=] _ Search for any character not equal to =
      + ____ Search for any consecutive string of the previous match, with at least one
      () ___ Groups an expression to be able to re-place it
      = ____ the = sign
      $ ____ Search for the end of the line

      \1 ___ Re-place the first grouped expression ()
      = ____ re-place the = sign
      \1 ___ Place the first grouped expression again