Hi, @real_1bx, and All,
This time, due to the simultaneous search of an entire line, with its line-break, when a digit follows the colon char, we need, again, two groups, leading up to that regex S/R :
For instance, the input text, below :
would be modified as :
Hi, @сергій-бородін and All,
Thinking back on your problem, here is a second method, requiring fewer steps, but which will classify each non-duplicated tag, according to a different layout !
So, assuming the same initial text, below :
First this simple regex S/R, changes all this list in a one-line list :
Open the Replace dialog ( Ctrl + H )
REPLACE # ( Any symbol, not used yet, can be chosen )
Select the Regular expression search mode
Click on the Replace All button
Which gives the single line, below :
Now, here is the regex S/R, which deletes any duplicated tag ( The same regex, described in my previous post ) :
REPLACE Leave the zone EMPTY
Your text should be shortened as below :
Finally, this regex S/R, below :
Replaces any semi-colon, right after the string eps with a comma
Replaces any # symbol with a line-break ( \r\n or \n )
REPLACE ?1\r\n:eps, OR ?1\n:eps, if you works with an Unix file
And we obtain the final output :
As you can see, the 21 non-duplicated tags ( From tag0 to tag20 ) are arranged differently, with many lines without tag, at beginning of the list !
@Jeffrey-Snively said in File Type issue:
Now I have a different problem. With some file types (including .txt), when I go Right-click>Open With>Choose Default Program, it gives me the option to select NPP. I select it and check the “Always use this program” box. Then when I look in Windows explorer, it shows the file type for all my .txt documents as “Notepad++ Document” instead of “.txt file” or something.
Old thread but I had same issue and this was the top google result so maybe this will help someone in future. Open regedit, go to “HKEY_CLASSES_ROOT\Notepad++_file”, instead of “Notepad++ Document” leave the description empty and reboot your PC. Thanks for someone over at SU providing this.
On re-reading, I saw a fine point I may have missed: if you only want to delete parenthesized items when it starts with (tstamp, then slight change:
FIND = \(tstamp.*?\)
The rest remains the same.
(blah keep this) (tstamp blah blah) (blah keep this)
(blah keep this) (blah keep this)
If you have more requirements (the paren must start at the beginning of the line and/or end at the end of the line, or other such modifications), those refined requirements can be met. However, you will need to be more explicit.
Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as plain text using the </> toolbar button or manual Markdown syntax. Screenshots can be pasted from the clipbpard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get… Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.
First of all thanks for the examples.
We can see that you have made an effort to explain your goals.
Unfortunately, at least for me, the explanations are confusing, so I don’t really understand what you want to do.
Obviously, like me, English is not your first language, so I would recommend that you use an Online Translator to help you.
Please note, the better/precise the question in your mother tongue is set, the better the translation will be.
To the questions:
Use the find dialog, go to the Mark Tab and mark the hits, optionally set bookmarks for each line
Probably a regex search for \(.+?\) could provide this.
How do you know if a sentence begins or ends. For this you actually need an AI that was really programmed for it and even this one won’t work 100%
and 5. I do not understand.
Translated with www.DeepL.com/Translator (free version)
sometimes log files (in a variety of extensions) are in 8 space tabs
If all of the 8-space logs were all part of the same builtin syntax-highlighting lexer (entry in the Language menu), then it wouldn’t matter if there were many extensions or just one. However, there isn’t really a logfile builtin lexer, and even if you created a UDL, the UDL don’t have their own tab settings – they just use the default.
Thus, the only way I know to accomplish your task is with a scripting language.
If you want a manual toggle, you could do it by sending the SCI_SETTABWIDTH message to the active scintilla editor component. But you’d have to be willing to install either the NppExec or PythonScript or LuaScript plugin (from Plugins Admin), or externally through Perl’s Win32::Mechanize::NotepadPlusPlus module.
As a brief intro,
in NppExec (which is a Notepad+±specific “shell” or “batch” language), you would define two scripts, one would be named SetTab8 and run sci_sendmsg SCI_SETTABWIDTH 8; the other would be named SetTab4 or similar, and would run sci_sendmsg SCI_SETTABWIDTH 4
in PythonScript, you could do it with two scripts, named similarly, using the syntax editor.setTabWidth(n) where n is either 4 or 8. Or you could get a little fancier and do something like n = 12 - editor.getTabWidth(); editor.setTabWidth(n); which would allow one script to toggle between 4 and 8. Or even fancier, and have it look at the active file’s type or extension to decide whether to set it to 4 or 8 or leave it unchanged.
I don’t use LuaScript, but the syntax would be similar
In Perl, it would use nearly the same syntax as PythonScript, except using -> instead of .
I see that @Ekopalypse chimed in with the short version of this while I was typing. :-) That’s what I get for being “the wordy one”. ;-)
Anyway, if you want to do it with a scripting language, let us know. If you tell us which language you’d prefer to use, we can help you through the steps of installing the plugin, adding the script(s), and getting them assigned to keyboard shortcuts.
Please try this information,To remove column
Use Alt+Shift+navigation keys, or Alt+Shift+click to do a block select of just that column. Then simply press Delete.
I hope this information will be useful for you.
hi, first of all i had a similar problem and it took a long time to solve the problem. as a result, I solved the problem completely and the steps should be as follows; First, you should uninstall Notepad ++ from the program manager, then open the file manager and select the option to show hidden files, folders and drives again in the window with the options> options> folder. then say okay close the windows. Open this computer window and search by typing Notepad ++ in the search box. after doing all these, run the registry editor searching CTRL + S Regedit, close all open folders, click on the computer and open the search window with the combination of CTRL + F Search the name Notepad ++ and delete the found files. Use the find next option to find and delete all, then restart your computer. Download notepad ++ x86.exe and x64.exe, then install the first x86. disable run when finished setup. then install the x64 version without running anything. When installation is finished run and close notepad ++. then reload the x86 version and all settings will be reset.
Hi, @alan-kilborn, @peterjones, @ekopalypse, and All,
Alan and Peter, thank you so much for these clarifications ;-)
Although the last Boost regex 1.7.3 version is not used and that Notepad++ is build with Boost v1.7.0 since N++ v7.8.0, the differences between the search regex documentation of Boost versions v1.5.5 and v1.7.0, mentioned in my previous post, are identical and are still valid ;-))
So, the good news is that our new regex library does support the Perl's backtracking control verbs. Woooow !! I’m quite eager to investigate this new side of regular expressions:-)) I will keep you informed of the interest of these new functions and will try to provide you with relevant examples for a better understanding…
As a result, I have also updated the FAQ contents !
Now, while browsing the Boost C++ libraries website, I came across a thorny problem : when we speak of Boost v1.70.0, I think that it’s an abuse of language ! Because the strings 1.55.0 and 1.70.0 refer to a documentation version and NOT to a library version :-( Indeed :
Formerly, we were using the Boost-Regex library from the Boost-1.54.0 version of the Boost C++ libraries and we referred to its Boost 1.55.0 library documentation
Since Notepad v7.8, we’re using the Boost-Regex-5.1.3 library from the Boost-1.64.0 version of the Boost C++ libraries and we refer to its Boost 1.70.0 library documentation
Refer to all these links, below. It’s a bit tricky !? Compare the different links, two by two
Could you confirm my guesses ? TIA !
The last version uses the Boost-Regex-5.1.4 library from the Boost-1.72.0 version of the Boost C++ libraries and refers to the Boost 1.73.0 library documentation