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
link|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. – Adam543i Sep 25 '11 at 10:24
feedback

1 Answer

up vote 11 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...

link|improve this answer
6  
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
@EdStaub Notepad++ is based on Scintilla, just like SciTE, but not SciTE itself, AFAIK. – Daniel Beck Sep 25 '11 at 15:06
Well, I learnt something new today! :) – Anonymous - Sep 25 '11 at 20:56
feedback

Your Answer

 
or
required, but never shown

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