Copy first 10 character of line to end of line

Copy first 10 character of line to end of line

2
NewbieNewbie
2

    Feb 04, 2005#1

    I have a file were I need to copy the first ten character (a unique code) to the end of the line:

    This is the original
    QPH11002450A.help=Remarks

    This should be
    QPH11002450A.help=Remarks (QPH11002450A)

    Each line has a different length, for example;
    QPH11002450A.help=Remarks to the manager

    Each line starts with 3 characters and is followed by 8 or 6 numbers and one character. Basicly I need the text before the "." copied to the end of the line.

    How can I do this with reg. expressions / find and replace?

    46
    Basic UserBasic User
    46

      Feb 04, 2005#2

      Hi RedShark,

      Try this (without the quote""):

      Find: "%^([a-zA-Z_0-9 ]+^).^(*^)$"
      Replace: "^1.^2 (^1)"
      Check: Regular Expression

      This should make the job (expecting there is no other chars
      than letters, numbers, underscore or space before the "." and
      at least one of them).

      Regards,
      Alain
      Never forget: "Above the clouds, The sky is blue and the sun shine"

      2
      NewbieNewbie
      2

        Feb 04, 2005#3

        Hi Palou,

        Thanks, it worked great! And your example showed me a littble bit more of the use of regular expressions in my code! :D