How can I have multiple cursors in Notepad++?
I will have a couple of tab delimited values . I need to write a query for all of these values. For example, if I get a
Notepad++ also handles multiple cursors now.
Go into Settings => Preferences => Editing and check "Enable" in "Multi editing settings" Then, just use Ctrl+click to use multiple cursors.
Feature demo on official website here : https://npp-user-manual.org/docs/editing/
Notepad++ only has column editing. This is not completely the same as multiple cursors.
Sublime Text has a marvelous implementation of this, might be worth checking out...
It's a relatively new editor (2011) that is gaining popularity quite fast:
http://www.google.com/trends/explore#q=Notepad%2B%2B%2C%20Sublime%20Text&cmpt=q
Edit: Apparently somewhere around Notepad++ version 6.x multi-cursor editing got added, but there are still a few more advanced features for it in Sublime, like "select next occurrence".
You can use the plugin ConyEdit to do this. With ConyEdit running in the background, follow these steps:
cc.spc /\t/ a
to split the text into columns and store them in a two-dim array. cc.p
to print, using the contents of the array. You can add/edit content on multiple lines by using control button. This is multi edit feature in Notepad++, we need to enable it from settings. Press and hold control, select places where you want to enter text, release control and start typing, this will update the text at all the places selected previously.
Ref: http://notepad-plus-plus.org/features/multi-editing.html
Notepad++ has a powerful regex engine, capable to search and replace patterns at will.
In your scenario:
Click the menu item Search\Replace...
Fill the 'Find what' field with the search pattern:
^(\d{4})\s+(\w{3})\s+(\w{3})$
Fill the replace pattern:
Insert into tbl (\1, \2) where clm = \3
Click the Replace All
button.
And that's it.
The easiest method to solve your problem (without going to a different editor or learning regex) is to record a macro.