A good plain text editor is like the Swiss army knife of software: it’s a knife, a screwdriver, a scissors, a toothpick, and so much more all in one. If you’re drawn to simplicity, then plain text is for you. Plain text can also form the basis of a whole productivity system, as Caleb McDaniel explains.
Recently on ProfHacker, Lincoln and Konrad have sung the praises of working in plain text. As Lincoln pointed out in his post on Markdown:
plain text is a great format to use because (1) it can be read by any computer or device; (2) it’s future proof, since computers will always be able to read it; (3) it can be synced to all your devices; (4) it can be converted to virtually any format
Konrad’s been demonstrating the efficiency of regular expressions which are typically built into a full-featured plain text editor, like Notepad++ or TextPad for Windows, or TextWrangler or TextMate for Mac.
Personally, I use a plain text editor for many different kinds of tasks, such as: taking quick notes on or for mobile devices; drafting blog posts before putting them into WordPress; copying URLs and other online information; writing bits of HTML for my course modules in the university’s CMS; quick copying of text from one program to another; and cleaning data before putting it into MySQL. Obviously, you could use other kinds of software for most of these tasks, but I like the simplicity of using one lightweight tool.
Although I knew that both TextPad and Notepad++ have a bookmark feature that allows you to mark all instances of something you’ve searched for, I had never really paid attention to the “invert bookmark” feature until a few weeks ago, when I needed to use it.
Sometimes you need to search for something -- a word, phrase, or pattern in a document. Simple search will help you find a word, and a regular expression search will help you find all instances of a certain kind of pattern (say, a five-digit number, if you’re looking for zip codes).
But what I wanted to do was to quickly delete from a document everything except the pattern.
I was comparing the journals indexed by two different bibliographic databases in my university’s library. I had obtained a list of titles with ISSN numbers for each of the two databases, but the two lists were in very different formats and included multiple lines of additional information for each title that I didn’t need.
I wanted to reduce each of these lists down to just a list of ISSN numbers that I could sort and quickly compare. I could easily use a regular expression to locate each instance of the ISSN, but selecting and deleting all the other additional text by hand would take far too long for the extent of my interest in the question.
A couple of minutes of Googling gave me the solution, which was right in front of me in my text editor all along: (These specific instructions are for TextPad, but the same features are present in most text editors more advanced than the built-in system Notepad.)
- Search for the word or pattern you want to keep
- Choose “Mark All” to bookmark each line of the document that contains the word
- Then select “Invert Bookmarks” to mark all the lines that do not contain the word
- From the edit menu, choose “Delete Bookmarked Lines”
Now that I know about how to use invert bookmarks, it seems really obvious, but I was really happy when I discovered this use for the feature.
What do you use bookmarks or invert bookmarks for in your plain text editor? Let us know in the comments!
[Creative Commons licensed image by flickr user Sonjasun]