Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a simple array in Notepad++:

bla.vmt"
bla.vtf"
bla_exponent.vtf"

I want to get rid of the lines ending with .vmt and _exponent.vtf.

share|improve this question

migrated from stackoverflow.com Nov 18 '12 at 16:30

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

up vote 2 down vote accepted

To remove lines ending with .vmt, use Search and Replace and select the Regular Expression option. Give the regular expression as

[^%]*.vmt

This will replace all lines that end with .vmt.


Similarly, to replace lines ending with _exponent.vtf, use:

[^%]*_exponent.vtf

as the regular expression.


The regular expression [^%]* means match all characters other than %.

share|improve this answer
    
Since Notepad++ 6.0 PCRE regex is used, so [^%] will also match newline characters. This solution will match far too much and even anchors to the end of the row are missing. –  stema Nov 19 '12 at 9:41
add comment

Similar to what Raam answered, but with the regular expressions

^.*\.vmt"$

^.*_exponent\.vtf"$

The dot before the extension should also be escaped with backslash.

^ marks the beginning of a line.

$ marks the ending of a line.

share|improve this answer
add comment
  1. Use Find to mark all lines

    1. Ctrl + F to open the Find screen

    2. Go to the "Mark" Tab

    3. Check "Bookmark line" option

    4. Check the Regular expression option

    5. Use vmt$ as regex to find all lines ending with "vmt". $ is the regex anchor that matches the end of a row.

    6. Press "Mark All"

  2. Go to the "Search" menu, "Bookmarks ==> Remove Bookmarked lines"

Similar for your other case, you can use exponent\.vtf as regex. To match a literal "." with regex, you have to escape it \., because it is a special character in regex.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.