Notepad++ Remove Empty Spaces or characters after the specific LAST character

42 Views Asked by At

Is there any way to tell Notepad please do this...

FROM THIS

15.63387,46.42795,1,130,1,210,Sele pri Polskavi

TO THIS

15.63387,46.42795,1,130,1,210

I would like to remove everything after the last , (after number 210)

So that in the end it looks like

15.63387,46.42795,1,130,1,210

Thing is when I try it using Notepad++ with the command

FIND = [[:alpha:]] or [\u\l]
REPLACE = (leave it empty)

It removed all alphabetical characters but it leaves , signs at the end, which I can remove with .{1}$ but for some reason some lines have empty spaces after , sign.

Some lines have one or more and this command .{1}$ does not work since notepad++ sees empty space as a character and therefore does not remove all the , signs at the end of each line.

1

There are 1 best solutions below

7
Toto On BEST ANSWER
  • Ctrl+H
  • Find what: ,[^,\r\n]+$
  • Replace with: LEAVE EMPTY
  • TICK Wrap around
  • SELECT Regular expression
  • Replace all