January 7, 2014

How to delete blank or certain lines in a text file?

Notepad++ is the text editor used for these tasks. Refer to this Techbit in case you're not aware of it.

How to delete blank lines?

Under the menu path “TextFX” >> “TextFX Edit”, there exists an option “Delete Blank Lines” to serve this purpose. A similar option to achieve this is present under “Edit” >> “Line Operations” as well.

How to delete certain lines i.e. lines having a specific text pattern?
  1. Search i.e. Ctrl+f
  2. Select the “Mark” tab
  3. Put in the pattern you want to search for
  4. Tick the checkbox of “Bookmark line”
  5. Select “Mark All”
  6. Select the menu path “Search” >> “Bookmark” >> “Remove Bookmarked Lines”

No comments: