Discussion:
[Notepad-plus-plus] [notepad-plus - Help] How do I do this?
SourceForge.net
2009-09-04 14:24:03 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7609276
By: abc1232

Suppose and have a block of line in the np++ editor and want to delete everything
start from certain column, how do I do that? Thanks ahead...

e.g. I want to delete everything left of E for every line.

ABCDEFGHIJKLMNOP
ABCDEFGHIJKLMNOP
ABCDEFGHIJKLMNOP
ABCDEFGHIJKLMNOP



______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331754
SourceForge.net
2009-09-04 20:20:54 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7609905
By: glenntravis

Short of replacing 'ABCD' with nothing (I know that is not what you intended),
or using the macro functions (not sure that would do it either), I do not think
it can be done. Never seen any editor that could without some kind of macro.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331754
SourceForge.net
2009-09-04 22:03:48 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7610039
By: fool4uanyway

Perhaps you could be a little more specific, so any answer could be more
accurate.

I suggest you read about (search the forums for) regular expressions, possibly
in combination with words like delete and start (of) line.

In your example case, possible solutions are:

1. Block selection and deletion.

Select all lines you want to delete the first four characters of (although your
descriptions says "delete everything start FROM certain column"). Move cursor
to the first line, press and hold down Shift, move cursor to the last line,
press CursorRight three times, then press and hold down Alt (and still Shift),
press CursorRight one more time. Now you have selected the first four columns
on all desired lines. Press Delete to delete this columnar selection.

2. Delete the first four characters on each (selected) line by a "simple" regular
expression.

Select all lines the normal way, no block selection, do not use Shift.
Press Ctrl+R to open the Text FX Advanced Find/Replace Dialog.

In the Find Field, enter:
^....

Leave the Replace Field blank.

Mark the Regular Expr checkbox on the right side.
Mark the 1 per line checkbox on the right side.

Find and Replace (Rest) all occurrences.

It can't be done this way using the normal Ctrl+H Replace Dialog, because it
will recursively remove the first four characters of each processed line. So
you will only be left with the last 3, 2 or 1 characters of each line. This
is a shortcoming in the regular expression engine. As soon as it did process
the ^ start of a line, it should never accept the remainders of it as the "start"
again (unless, of course, the Recurse Repl checkbox in the Ctrl+R Dialog is
checked).

3. Delete all non-matching characters from the start of a line

Using the following regular expression you can delete all characters until the
first E on each line.

Find Field:
^[^E]+

4. You may find more specific examples by searching the forums.


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331754
SourceForge.net
2009-09-04 22:06:44 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7610044
By: cchris

If your lines are all of the same length, I'd do this:
move crsor before the 1st character to delete, and alt+click there
alt+shift+down until the last line to operate on
alt+shift+end to select the whole block of text
delete

If all lines don't have the same length, repeating the procedure may help

HTH
CChris

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331754
SourceForge.net
2009-09-09 18:48:04 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7619733
By: abc1232

Thanks for the tips everyone. Those were very helpful... :)

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331754

Loading...