0

In every line I would like to:

  • remove char 1-8 (8)
  • save char 9-12 (4)
  • remove char 13-16 (4)
  • save char 17-20 (4)
  • replace char 21 (1) with space
  • keep the rest of line

and then do it for every line

I have started with:

^.{8}(.{4}).{4}

Is it possible to in oneline or repeat the pattern...

(I use Notepad++ and TextPad)

KiAnKo
  • 71
  • 1
  • 8

1 Answers1

2

This should do the trick. Simply count the characters as you've done and replace with the capture groups and a space.

Find

^.{8}(.{4}).{4}(.{4})(.{1})

Replace (incl. the space after $2)

$1$2 

https://i.gyazo.com/e0b5d392caaaccfb8747cc15e37e3e96.gif

ʰᵈˑ
  • 11,279
  • 3
  • 26
  • 49
  • 1
    `{1}` is superfluous and there is also no need to capture the last character, as you wont use it. Apart from that, that's how I would do it too. – Sebastian Proske Apr 13 '16 at 15:47
  • 2
    TIL you can use `$1` in the replace, I always used `\1` – Mr. E Apr 13 '16 at 15:51
  • I used: `^.{8}(.{4}).{4}(.{5})(.{1})(.{1})` and preplaced it with: `\1\2 ` with a "space" after "2" which solved my problem in my problem. – KiAnKo Apr 15 '16 at 12:09