Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad ++ How to remove all characters standing before a specific character

I searched all around but couldn't find any solutions.

I have:

<option value="1">Advertising
<option value="11">Aerospace
<option value="12">Agriculture
<option value="13">Architecture/Urban Planning
<option value="14">Arts
<option value="15">Automotive
<option value="16">Banking
<option value="17">Biotech & Pharmaceuticals
<option value="18">Business Services
<option value="19">Chemicals

I want delete all of text before the "> so the unnecessary text like <option value="1"> will be gone, only the Job type name such as Advertising being kept. How can I do it?

like image 353
Ronaldinho Learn Coding Avatar asked Jul 21 '13 20:07

Ronaldinho Learn Coding


People also ask

How do you delete all text before a character or string in Notepad++?

Do you want to delete everything before the | and including the | character. You can try find: (. +\|) and leave replace empty.

How do you get rid of a certain character in a string?

Using 'str. replace() , we can replace a specific character. If we want to remove that specific character, replace that character with an empty string. The str. replace() method will replace all occurrences of the specific character mentioned.


1 Answers

Alternatively, you could simply put the cursor between the > and C charters, then use Alt + Shift + Up Arrow to select multiple lines. Then hit the backspace key.

Cursor goes here--v--------
<option value="19">Chemicals  

This assumes all the lines line up. Dead useful for manipulating these types of files. Works usually in other programs too (Visual Studio, SSMS, etc).

like image 59
Mr. C Avatar answered Oct 06 '22 00:10

Mr. C