Emeditor : When using the extract feature : how to also remove the extracted contents (rows) from the source document? - text-extraction

Example : the file "A.txt" contains several rows with phrases :
This is a phrase
Bla keyword blabla
This is another phrase
Desired results :
in A.txt :
This is a phrase
This is another phrase
in B.txt :
Bla keyword blabla
Then I use the option "Find" keyword then I use "Extract". It extracts the correct rows in a new document (B.txt) but how to also remove the full row(s) containing the selected keyword in "A.txt" ?

This can be easily done with EmEditor. I have provided two methods.
Method 1
Select a keyword, right-click on the selection, and select Filter Out.
Click Extract All on the Filter toolbar.
Save as a new file name.
Method 2
Select a keyword, right-click on the selection, and select Filter.
Make sure Block Multiline Changes is disabled on the Filter toolbar.
Press Ctrl + A to select all text.
Press Delete.
Click the Abort button on the Filter toolbar.

I do the same thing a lot in EmEditor and using only the keyboard, this is the quickest way I know.
Here are my steps:
Highlight the search string and open the Find dialogue Ctrl + F
Alt + T to Extract the lines into a new document/tab
Esc to close the Find dialogue (not needed if option Close when finished in the Find dialogue is active).
Go back to the original source document Ctrl + Tab
Re-open the Find dialogue Ctrl + F
Bookmark the lines Alt + B
Esc to close the Find dialogue (not needed if option Close when finished in the Find dialogue is active).
Delete the bookmarked lines Ctrl + Shift + Backspace
Steps 3 and 7 can be skipped if using the mouse to select the original source document. I just haven't figured how to activate it with the keyboard while the Find window is still open.

Related

Atom: How do I create shortcut to select a word and search?

I got really used to cmnd+d, cmnd+g and cmnd+d, cmnd+shift+g workflow in sublime text. Is it possible to reproduce the same behavior in Atom using keymap.cson or some other tool?
Here is step by step description of the expected behavior:
I put my cursor on a word.
I press cmnd+d, the word gets highlighted and silently copied to search input. Not silently would be ok.
If I press cmnd+g, the selection goes to the next occurrence of the word. If I press cmnd+shift+g, the selection goes to the previous occurrence of the word.
If I press cmnd+d, I select the current and the next occurrence of the word.
I'm running Linux instead of Mac and I'm not sure what the differences are, but here's the closest method I've found:
Put your cursor on a word
Press Ctrl+F3 to select the next occurrence of the term or Ctrl+Shift+F3 to select the previous occurrence
I say "term" instead of "word" because its behaviour depends on whether whole word matches are enabled in the Ctrl+F menu.
Press Ctrl+D once to select the current word, and again to select the next occurrence of the word
Also:
Ctrl+F searches for whatever's selected
Alt+F3 selects all occurrences of the current word

wrap ctrl + enter in str() function r

I often find myself using ctrl + enter to run something in r-studio. I often find that I would like to be able to wrap whatever I am putting into ctrl + enter in the str() function.
This is particularly the case when I am piping lots of dplyr verbs together. Mutating new variables and joining dataframes etc. Sometimes halfway through the set of piped commands I need to check what the name of a variable in a dataframe that i have created is called so that i can access it via the next pipe. This usually means that i have to:
highlight the text up to the last relevant pipe
hit ctrl + enter
press the up arrow
add a bracket to the end of the pasted text
Press home
navigate via the arrows to the first line of the pasted text
type: str(
This is extremely laborious and I find myself doing it often. Is there a shorter way that I am not aware of? Otherwise is there a workflow process people use to get around this?
Ideally there would be a modified ctrl + enter shortcut that would wrap whatever is highlighted in str() and output the result to the terminal.

How do I advance to the next occurrence of a variable in R Studio IDE

When I highlight any string of text in the R Studio console a rectangle is drawn around all other occurrences of this same string of text. How do I advance to the next occurrence of this arbitrary string of text? I'd like the keyboard shortcut.
CTRL-F3 is the closest shortcut I know. This takes the selected string of text, drops it into the Find dialog and jumps to the next occurrence (keep pressing CTRL-F3 to cycle through)
If you would like to move to the next occurrence of a word/variable and select it while also keeping the original selected, this command exists but does not have a default shortcut assigned to it.
The command is called 'Find and add next' (or 'Quick Add Next' in older versions). You can assign a shortcut to it by going into Preferences -> Code -> Modify_Keyboard_Shortcuts. I use Alt+Cmd+Right (on a Mac) as that is an unassigned key binding.
You can see bellow I have used the command twice to select three of the four instances.
On a Mac, I use command+f to call Find with a selected string and then use control+g to move onto the next match.
This needs to be over 30 characters, but only needs 2:
F3

Replace-all-occurences keyboard shortcut for Atom under Linux

In Mac OS X Ctrl+Cmd+g replaces a word in the whole file. What's the alternative to that in Linux?
I tried to check the keybindings, but no luck.
You can use Command+. to active the Key Binding Resolver to look for the actual function bound to the shortcut on your Mac and search the function on Linux Atom to figure out what the key combination is.
Alternatively, your can search all your key binding here (see screenshot below) which accept both key combination and command name.
Using ctrl + e when you are on a word will open the find and replace panel for this word.
Then use tab to go into the "replace in current buffer field", type your replacement word.
Finally, hit enter to replace the occurrences one by one, or ctrl + enter to replace all.

inserting line breaks after every record in the textpad

I have a textpad file that has rows of text. For e.g.
Cat: Meaning - animal. The cat ran up the house
Rat: Meaning- rodent. The rat lives in the borough and feeds on leftovers
Word 3: Description
Word 4: Description
I have many such record in my file. I want to insert a line break at the end of every record for proper presentation. Doing it manually is tedious. Please help if you know an automated process to insert line break.
You can quickly do this by using a feature called "Regular Expressions" to find and add empty lines.
Open up the Find/Replace (Search menu > Replace)
In the "Find what" field, type the following: (^.+$)\n(^.+$)
In the "Replace with" field, type the following: \1\n\n\2
Tick the "Regular expression" checkbox
Click the Replace All button at least twice, but perhaps 3 times, until you get the message Cannot find the Regular Expression
Untick the "Regular expression" checkbox
Close the Replace dialog
Confirm the file is formatted as you are expecting
Save the file.
You can write a simple C# prgram that uses a loop that adds this code after every line :
But first add the namespace using System.Enviorment
Enviorment.NewLine;
If you have any more trouble i'll help with some code to get started
Open up the Find/Replace (Search menu > Replace)
In the "Find what" field, type the following so that the replace occurs at the end of each line: $
In the "Replace with" field, type the following. Note each 'n' represents a <return>. In this instance, I added a return at the end of a SQL statement, the word 'GO' on the next line and another <return>: \n\GO\n
Started with text file containing:
select * from <tablename>
select * from <tablename>
Ended with text file containing:
select * from <tablename
GO
select * from <tablename>
GO
Hope that helps.
from your text it is difficult to understand what you are intending to do. I'll give you some questions. The answers will help others to help you.
Do you really mean textpad as the product from company helios in UK or do you use this word as a general word for a class of tools (like notepad - but there is a general definition AND the tool as part of Windows).
Your file hase line breaks yet. You don't see them, but in the file itself they are present (in Unix systems line feed (hex code 0A) or in the windows world carriage return followed by line feed (hex code 0D 0A)).
Or would you like to publish your text in HTML? So you have to put the necessary tags around each line like paragraph, line break, list item etc.?

Resources