Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
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 '11 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 '11 at 10:24
up vote 49 down vote accepted

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...

share|improve this answer
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 '11 at 11:25
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 '11 at 12:46
Loving the Alt for rectangular selection!! – Gromer Sep 14 '12 at 21:27
Alt selection simple and easy. Thanks Daniel Beck. – Uday Kiran Thummalapalli Apr 9 '13 at 17:49
wow! thanks for that rectangular selection tip... I wasn't even aware that something like that exists... – Fr0zenFyr Sep 3 '14 at 7:49

In newer versions of Notepad++, you can use repetition counts. Just replace ^.{1,27} with empty string.

share|improve this answer
Of course, if it's guaranteed to be exactly 27 characters, just use ^.{27}. – Schism Jun 2 '14 at 17:16

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.

share|improve this answer

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


and replace with:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .