May 9, 2013

Notepad++ plugin for viewing JSON data and other benefits

Q. Why is Notepad++ is a very handy tool?A. Notepad++ is a very handy developer tool. Here are some of the productivity benefits of Notepad++.

to view source code as a free and light weight source code editor that runs in Windows environment. You can also use it to view log files and other text data.

It can be used for syntax highlighting, line numbering, search and replace with or without regular expressions, modified file detection, file search, etc.

Working with JSON data

Recently, I had to work a lot with JSON data, and stumbled across a very handy plugin for Notepadd++ called "JSONViewer Notepad++", which allows you to format JSON data and view them as a tree structure. Here are the simple setps to install this plugin.

Step 4: When you open up your Notepad++, you will see the "JSONViewer" sub menu under the "Plugins" on the top main menu. You can format the JSON text by highlighting your text first and then clicking on Plugins --> JSON Viewer --> Format JSON.

Extracting data

If you had some tab limited data like

FirstName Surname Age
John Smith 25
Peter Warren 35
Lisa Jenkins 28

and if you want to extract out all the first names, you can invoke the column mode by pressing "Alt" key and then select the "FirstName" column with the mouse selection. Alternatively, you can use the "Alt+Shift+Arrow Key" to select the column entries you need. These options are under the "Edit --> Column Mode" on the top menu.

You can use the "Find In files" tab to replace multiple files. I use this feature to search for files that has certain text (i.e. grep). This is a bulk find and replace capability. It also has other bulk features like "File --> Save all" open files.

Split views, file comparisons and synchronized scrolling

Select View --> Move/Clone Current Document to create split views to compare two files side by side. On split views you can select Plugins --> Compare --> compare to highlight the differences or select View --> Synchronize Vertical Scrolling to scroll both views in tandem.

Language feature to highlight reserved key words

Setting the language of the file like Java, JavaScript, etc via Language --> J --> Java or JavaScript will help you easily visually distinguish between functions, reserved words, comments, text, and other types of symbols and expressions in your code.

The latest Notepad++ version should have a TextFx menu to tidy up HTML tags to be XHTML compliant. You can also automate any monotonous tasks you do repeatedly with the Macros. It can also synchronize files with Subversion (i.e. SVN). Hence Notepad++ is a powerful open-source developer tool that makes you more productive.