Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the last 13 (or n) characters of every line using Notepad++

I have a file which each line that ends with Mar 15, 2013 and other dates so I need to remove the end of each line say the last 13 characters

Each line is a different length and has different characters so cant use anything as delimiters.

like image 900
Aswin Chandru Avatar asked Mar 16 '13 21:03

Aswin Chandru


People also ask

How do you remove the last 3 characters in notepad?

But just use the find and replace. Look for ":\n" and replace with "\n" or something like that. You may need to mess with the find and replace options.

How do I remove a number from a text in Notepad?

Assuming the numbers column is a constant width, you can simply hold down the ALT key while dragging a rectangle over the area you want to delete. Once it's highlighted, just press either the delete key or the backspace key.


1 Answers

You can use a regular expression in the search and replace-dialog (Ctrl+H) that is anchored to the end of the line:

.{13}$

Then replace it with nothing. And of course you could use a more expressive regex to match only dates in your particular format and nothing else.

like image 109
Bergi Avatar answered Sep 21 '22 19:09

Bergi