The MPLAB® X IDE does not have a built in capability to perform rectangular edits, but there is a Netbeans plug-in that will add this very useful functionality. Specifically, the plug-in supports the following operations:
- Rectangular Cut
- Rectangular Copy
- Rectangular Paste
- Rectangular Delete
- Rectangular Clear
- Rectangular Replace
After installation the plug-in will add extra items under the Edit menu. Using the plug-in may seem a little strange at first since there is no built-in mechanism to make rectangular selections. The workaround is to make ordinary selections in a specific way that will be interpreted by the plug-in as a rectangular selection. As an example, consider the array defined below:
int dataTable[] = {
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9
};
1
Let's say you want to replace the "8,9" at the end of the last three rows with the "3,4" from the first row. First highlight your source data by selecting the corners of the data you wish to copy:
int dataTable[] = {
0,1,2,[[span class="highlight"]]3,4[[/span]],5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9
};
Type Ctrl-Alt-C to copy the data.
2
Next highlight the destination by selecting the corners of the target range. By corners I mean start the selection at the top left most item and end the selection at the bottom right most item. It will look like you are selecting multiple rows, but for this plug-in, it only cares about the starting and ending points (characters in red) - these define the bounds of the rectangle:
int dataTable[] = {
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,[[span class="highlight"]]##red|8##,9,[[/span]]
[[span class="highlight"]]0,1,2,3,4,5,6,7,8,9,[[/span]]
[[span class="highlight"]]0,1,2,3,4,5,6,7,8,##red|9##[[/span]]
};
3
Type Ctrl-Alt-V to paste and you will end up with:
int dataTable[] = {
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,##red|3,4##,
0,1,2,3,4,5,6,7,##red|3,4##,
0,1,2,3,4,5,6,7,##red|3,4##
};
A true, built-in rectangular selection/edit feature should be available when MPLAB X is migrated to the NetBeans 7.1 platform. Until then, this plug-in will perform the task adequately.