How would I delete the first 27 characters from every line Notepad++?
Solution 1:
Use regular expression search, search for ^...........................
and replace with (empty string).
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
.
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...
Solution 2:
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
Solution 3:
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.
Solution 4:
a small improvement to Daniel Beck answer:
Use regular expression search, search for:
^...........................(.*.\r\n)
and replace with:
\1
Solution 5:
maybe just select text with ALT + Mouse left button