Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove first 16 characters of each line in text file

Tags:

regex

I am using Notepad++. I have already used some comands like ^..... but it didn't work.

How can I remove first 16 characters from each line?

This is a text line.

ramsandscriptstogetthebestinsightpossibleoutofitisthemostenjoyablepartofmyj

When I replace ^.{16} with an empty string, it gives me this:

lepartofmyj

I only want to remove first 16 characters.

like image 589
Rogue Marta Avatar asked Dec 11 '22 02:12

Rogue Marta


1 Answers

This worked for me (. matches newline must be unchecked)

RegEx: ^.{1,16}(.*)$
Replace: \1

If you want not match lines less than 16 characters, leave them alone, you can use

RegEx: ^.{16}(.*)$
Replace: \1

I tested both expressions against

0123456789abcdefthis
0123456789abcdefis
0123456789abcdefa
0123456789abcdeftest
0123456789abcdef
of
things
like image 179
Regular Jo Avatar answered Mar 03 '23 04:03

Regular Jo