I have a log file and I need to remove the first 27 characters off every line. You would have a line like this:

2011-09-25 01:25:29 [INFO] <Exazoro> wazup

But it needs to be like this:

<Exazoro> wazup
  • you could use some varient of the unix cut command from unxutils or busybox to do that much more easily - does it have to be notepad++?
    – Journeyman Geek
    Sep 25, 2011 at 10:21
  • @JourneymanGeek it dosn't have to be notepad++ its just waht i mainly use and it has macro and plugin support so i guessed there might be something to do that.
    – Mythrillic
    Sep 25, 2011 at 10:24

6 Answers 6


Use regular expression search, search for ^........................... and replace with (empty string).

enter image description here

Unfortunately, Notepad++ does not support repetition counts like ^.{27} — the SciTE regexp documentation applies here as well.

Alternatively, use rectangular multi-line selection (press Alt while selecting) to select these first 27 characters in every line, then press Delete or Backspace.

enter image description here

Using Unix tools (e.g. Cygwin, UnxUtils) you can use cut -c28- or sed -E "s|^.{27}||" instead. At least, these are the Linux command line calls you'd use...

  • 29
    Alt + Shift + right to select the 27 characters in the first row, then Pg Dn whilst still holding Alt + Shift should do it
    – icc97
    Sep 25, 2011 at 11:25
  • 1
    For the regex, Notepad++ doesn't follow all the standard regex rules, so I'm not surprised that you couldn't get it to work. And since it looks like the first 27 characters are a date, time, and error level, a more informative regex might be possible, like ^[0-9\-]+ [0-9:]+ \[[A-Z]+\]
    – MBraedley
    Sep 25, 2011 at 12:46
  • 5
    Loving the Alt for rectangular selection!!
    – Gromer
    Sep 14, 2012 at 21:27
  • Alt selection simple and easy. Thanks Daniel Beck. Apr 9, 2013 at 17:49
  • 1
    wow! thanks for that rectangular selection tip... I wasn't even aware that something like that exists...
    – Fr0zenFyr
    Sep 3, 2014 at 7:49

Since Daniel Beck's answer was originally posted, updates to Notepad++ now support the following regular expression repetition: ^.{27} But note with just that expression, Notepad++ will repeatedly remove all characters from the document until no more than 27 remain. To avoid this you can use the following Find/Replace:

  • Find what: ^.{27}(.*)$
  • Replace with: $1
  • this works perfectly!
    – Rudy
    Apr 29, 2019 at 5:39
  • This solution works in sublime as well!
    – neelmeg

Below is the macro way. This is more intuitive for non-technical people:

1) Place cursor on the first line (any cursor position)

2) Click : Macro -> Start Recording

3) Do the following key press activities:

* Press the Home key  
* Press Delete key 27 times (till you reach the intended character)
* Press down arrow button. 

4) Click : Macro -> Stop Recording

5) Click : Run Macro Multiple times -> select Run until the end of file -> click Run.


a small improvement to Daniel Beck answer:
Use regular expression search, search for:


and replace with:


maybe just select text with ALT + Mouse left button

  • Can you elaborate on this a little more?
    – Toto
    Oct 18, 2019 at 15:27

ALT + SHIFT + Mouse selection (only ALT is not working)

Point at the beginning of the file, go to the end hold ALT+SHIFT and point on the position u want to...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.