How to find and replace nth character from last in notepad++
-
Below is Original
AI 2015
Adu 2020
Ajji 2017
Akam 2011
Alai 2003I want ot Replace the Space before the Year with TAB like Below,
AI 2015
Adu 2020
Ajji 2017
Akam 2011
Alai 2003So i want to replace the 5th Charrecter from last… Any Help ?
-
Try a regular expression (regex) replacement. For example:
-
On the menu, click Search > Replace.
-
Select the Regular Expression option.
-
In the Find What box, enter:
\s([0-9]{4}\R)
This expression finds a space character, followed by a sub-expression containing four instances of a digit 0-9 and a newline. -
In the Replace With box, enter:
\t($1)
This expression replaces the found string with a tab character, followed by the Find What sub-expression. -
Click the Replace All button.
Vary the regex syntax according to the precise requirements of your file. For a detailed explanation of the syntax, see:
https://npp-user-manual.org/docs/searching/
https://www.boost.org/doc/libs/1_70_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html -
-
Wow…
Worked Perfectly…Thank you Verymuch…