How can I select the same set of characters that occur in multiple non-contiguous lines, then copy those entire marked lines to a new Notepad? - character

I have 3 characters "(CE" appearing in 1,000's of lines but not every one. How do I select all lines with that set of characters, then copy the entire set of lines out to a new Notepad ++?
thank you

Open the "Mark" tab of the search/replace dialogue, or use menu => Search => Mark.... Ensure that "Bookmark line" is selected. Enter the required search string, and click on "Mark all". The lines containing the search string should now be highlighted with blue circles on their left. Now use menu => Search => Bookmark => Copy bookmarked lines and then do a paste into a new buffer and save. The menu entries also show you the keyboard combinations, if any, that do the same tasks.

Related

Replace row header with images

I am working on a worksheet which has long header names. I want to display table compactly using icon images instead of using header labels. Say I have a column named "Population Density" in a table. I would like a population icon to show up instead of full label.
Probably the closest you could come with this is using Unicode Emoji in a column alias.
For measure values, right click the header and click "Edit Alias", then paste the unicode emoji into the text box.
For dimensions, right click the pill and click "Edit in Shelf". Move the cursor to the beginning of the line and press Shift+Enter to add a new line above, then press the up arrow. Type // on the new line, paste the selected unicode emoji, and hit Enter.

How to change every other blank space to tab in vs code

Let say I have a text like this
> Name
>
> Peak
>
> Surname
>
> Sornpaisarn
But I want the whole document to be written like this
Name Peak
Surname Sornpaisarn
So for the odd blank space, I want to change to tab. For the even blank space I want to delete it. Are there anything in vs code that can do that?
Make sure the final line is just >, so that the final key-space-value-space chunk is the same as the others
Make a backup copy of your page. If the edit ruins it, you can replace it and try something else
Choose "Replace" from the Edit menu
in the find/replace dialog, click the little .* box to turn on regular expressions
in the top (find) box, enter >\s([^\n]+)\n>\n>\s([^\n]+)\n>
in the bottom (replace with) box, enter $1\t$2
click in front of the first character in the file so you'll start the conversion there
click the little "replace" or "replace all" buttons (little b -> c icons to the right of the "replace with" text)

Copy Lines including carriage return linefeed in notepad++

Using Notepad++ I want to select individual, non-contiguous lines, copy them, and past them and include the CR/LF at the end. Preferrably, I would hold Ctrl, then click the line numbers I want, then press Ctrl+C or right click and select copy; however doing this selects all text (which is frustrating and doesn't make much sense). Furthermore, only selecting the line partially includes the line below it, so that if i press Ctrl+Shift+Up(or down) the line below it also moves up or down.
In summary, I want to copy non-contiguous lines and past them with their respective EOL characters.
Use Ctrl+F2 to mark desired lines.
Menu Search > Bookmarks > Copy bookmarked lines will copy these lines into clipboard.
As option for step 1, you can use Mark tab of Find dialog (Ctrl+F) with Mark Line option checked.

Convert Tabs-as-spaces width

I have many source code files which are idented with 8 space characters, I want to convert these to 4 character indents. What is the best way of doing this? A technique using eclipse would be preferable.
Select the project(s), then press Ctrl+H to open the Search dialog (or click the Search > File menu).
Make sure the File Search tab is selected at the top.
Enter 8 spaces into the Containing text: field
Select your File name pattern (probably *.java or just *)
Select the scope (probably Selected Resources)
Press the *Replace... button.
As I said in the comments above, however, using spaces for indentation is a fool's game; tabs are the proper abstraction for indentation so that you don't have this problem.

How to search and replace 2 lines (together) in Eclipse?

I would like to search multiple files via eclipse for the following 2 lines:
#Length(max = L_255)
private String description;
and replace them with these two:
#Length(max = L_255, message="{validator.description.len}")
private String description;
Another tip on how to get the regex for a selected block.
Open one of the files that contains the multiple lines (multiline) to search or replace.
Click Ctrl+F and select "Regular expression". Close the Find/Replace window.
Select the block you need and click again Ctrl+F to open the Find/Replace window.
Now in the Find text box you have the regular expression that exactly matches your selection block.
(I discovered this, only after creating manually a regexp for very long block :)
Search are multi-line by default in Eclipse when you are using regex:
(\#Length\(max = L_255)\)([\r\n\s]+private)
I would like to add "private String description;"
(\#Length\(max = L_255)\)([\r\n\s]+private\s+?String\s+description\s*?;)
replaced by:
\1, message="{validator.description.len}")\2
It works perfectly in a File Search triggered by a CTRL-H.
As mentioned in Tika's answer, you can directly copy the two lines selected in the "Containing Text" field: those lines will be converted as a regexp for you by Eclipse.
CTRL+H does take two lines if you use regexp (and you don't have to write the regexp by yourself, eclipse does that for you).
Select your lines.
Click CTRL+H. The search dialog opens up.
If "Regular expression" is already checked, eclipse will have converted the two lines you search for into regexp for you, click Search.
If "Regular expression" if not already checked", check it and click Cancel (eclipse remembers your choice).
Select your lines again.
Click CTRL+H. The search dialog opens up. This time "Regular expression" is already selected. eclipse will have converted the two lines you search for into regexp for you, click Search.
A quick tip for including multiple lines as part of a manually constructed regular expression:
Where you would normally use .* to match any character zero or more times, instead consider using something like (?:.|\r?\n)*. Or put an extra ? at the end to make it non-greedy.
Explanation: . doesn't match new lines so need to do an "either-or": The parentheses match either the . before the pipe or the new line after it. The ? after \r makes the carriage return before the line feed optional to allow Windows or Unix new lines. The ?: excludes the whole thing as a capturing group (which helps to avoid a stack overflow).
Click Ctrl + F and select "Regular Expression" and then search the lines. In case to perform the same on multiple files, click Ctrl + H, click on 'File Search' and perform the same.
Select the folder that contains all your files and press Ctrl+H.