Removing punctuation before a line
-
@УменяМодем-ОграниченныйТрафик said in Removing punctuation before a line:
first option I did not understand
The first solution of @Alan-Kilborn refers to the find dialog.
-
@УменяМодем-ОграниченныйТрафик said in Removing punctuation before a line:
the first option I did not understand, I am a novice - I do not understand what you mean, what are you talking about here!?
Really?
You are using a text editor and you don’t know about searching or how to do it?? -
Hello, @уменямодем-ограниченныйтрафик , @alan-kilborn and All,
So, I’m going to follow Rubber Duck method , too ;-))
A) Regarding the first option :
Assuming that all your lines begin with, either a comma or a dot, here is the method to delete these first characters with a search/replacement, already mentioned by @alan-kilborn :
-
Open the Replace dialog (
Ctrl + H
) -
Type in the regex
^[,.]
in the Find what: zone -
Leave the Replace with: zone
EMPTY
-
Tick the
Wrap around
option -
Select the
Regular expression
search mode -
Left-click on the
Replace All
button
=> DONE !
Notes :
-
The
^
is an assertion which looks for a beginning of line -
The
[,.]
is a class-character structure, which searches, either for acomma
or adot
symbol
B) Regarding the second option :
The usual way to perform a
Column Mode
selection is to use theShift + Alt + Arrows
shortcuts, as mentioned by @alan-kilbornHowever, in case of an huge selection, the easy solution is to use the
Begin/End Select
feature ! Here is the road map :-
Hit the
Ctrl + Home
shortcut to move to the very beginning of the first line of your current file -
Run the menu option
Edit > Begin/End Select
-
Now, hit the
Ctrl + End
shortcut to move to the very end of your file -
Press and hold down the
ALT
key and left click after the firstcomma
ordot
of the last line to select -
Choose, again, the menu option
Edit > Begin/End Select
=> After a while, needed to process all the lines of your current file, you should notice your
one
-column rectangular selection !- Finally, press the
Delete
key to suppress this first column
=> DONE !
Note : If you forget to hold down the
ALT
key, when located at the last line, you, obviously, get a normal selection of all your text !Best Regards,
guy038
-
-
This post is deleted! -
I didn’t understand anything on the first point - all that after Ctrl + H
-
@УменяМодем-ОграниченныйТрафик said in Removing punctuation before a line:
I didn’t understand anything on the first point - all that after Ctrl + H
Given your username, I am guessing that English isn’t your native tongue, which is fine. But if you are having trouble understanding the answers, try passing them through a translator like deepl.com or translate.google.com
About the most confusing part of @guy038’s answer was that he indicated setting the Replace With field/box empty by using
EMPTY
, which strongly implies literal text, which wasn’t what he was intending.For this time, I will supply a picture for you. I have marked up @guy038’s instructions with numbers in red, then put red notes on the dialog’s screenshot, so you can see how his instructions map to what actually appears. Fill out the Replace box so it looks like this:
After it’s filled out, click the Replace All button, or whatever that button says in your preferred language. -
I’ve tried this, all dots and commas disappear from the entire text!
I need it to disappear before the line!
This can be done!? - To disappear the dots and commas before the line as in my picture!?
I don’t need to delete punctuation from the entire text!
Only where the arrows show! -
@УменяМодем-ОграниченныйТрафик ,
If every dot and comma disappeared, you did not enter the Find what expression correctly. provide a screenshot.
In my example screenshot, there are only two matches, despite having four commas or periods. That’s because the search expression anchors to the start-of-line with the
^
If I replace all, then I get:
Notice that it did not delete all commas and periods, but just the ones at the beginning of the line.
I am assuming you forgot to include the
^
at the beginning of the expression, or otherwise didn’t type things exactly as @guy038 described and I showed the screenshot. Please show a screenshot of your Replace dialog both before and after hitting Replace All to show exactly what you are trying. -
Hi, @уменямодем-ограниченныйтрафик , @alan-kilborn, @peterjones and All,
In the Find what: box you must type in the regex
^[,.]
( NOT[,.]
)From this picture below, you should hold down the
Shift
key and hit the^ 6 ,
key on top of your main keyboard to produce the^
character, which is the regex char for beginning of line !Cheers,
guy038
-
Yes, everything worked out, thank you!
The first time I didn’t understand anything… the second time I didn’t notice my mistake…
And the third time you read that I understood everything! :)