• How do i merge lines (Pt. 3)

    10
    1 Votes
    10 Posts
    2k Views
    Faisal AlamF

    @guy038 Damn brother this worked perfectly tysm

  • Writing Kotlin in NP++

    4
    0 Votes
    4 Posts
    7k Views
    Michael VincentM

    @Jason-Tilford-0 said in Writing Kotlin in NP++:

    support the Kotlin language

    Depends on the degree of “support” you want. If it’s just lexing (coloring), then as @Alan-Kilborn says it is Scintilla-related. But again, if it’s only lexing (coloring) you want, you can try a User Defined Language route and create your own Kotlin parser. Lucky for you, our esteemed function list / UDL guru @MAPJe71 has a Kotlin UDL parser you can try.

    Cheers.

  • 2 Votes
    4 Posts
    252 Views
    Alan KilbornA

    @PeterJones said in How do I add a specific text at the end of each line start with same specific text:

    his worked for me without edits, without the braces. Though I agree that braces are a better idea, to avoid problems.

    Ha. I didn’t even try the original replacement string.
    It isn’t often that we get a request where someone actually has it right at the time of asking!

    I thought there was something special about 0, and you’re right, I just always err on the side of caution and do ${0}, ${1}, etc. I guess the special thing I’m thinking of about 0 is that you can’t do \0 like you can \1, \2, etc.

    Aside: Most people like the \1 notation because it is shorter than ${1} but I like the cleaner look of the latter, and “leaning toothpicks” make me crazy as well.

  • Deleting numbers from LIST 1, that also appear in LIST 2

    26
    0 Votes
    26 Posts
    3k Views
    guy038G

    Hello, @m-p, @peterjones, @alan-kilborn, @troshindv and All,

    Oh…! Indeed, dealing with two files of 7,400,000 and 1,200,000 lines is not an easy task ! So you will have to work with a 8,600,000 lines file : good luck !

    Do not hesitate to ask me for more information if you encounter difficulties in implementing my method !

    First, I would advice you to repeat my own tiny example, first, to get its general idea

    Regarding your real example, I would say that :

    The N++ sort feature is very quick, in all cases

    I suppose that the numbering operation, with the column editor, should not be very long, too !

    May be, the first of the three regex S/R will probably take some time. Just be patient : it should work in the end !

    Best Regards

    guy038

  • Merge lines using Regex

    8
    1 Votes
    8 Posts
    930 Views
    PeterJonesP

    Once again, @Faisal-Alam moved the discussion from this topic to a third new topic for the same discussion. For future readers, sorry for the inconvenience.

  • How to merge lines in bulk

    9
    0 Votes
    9 Posts
    1k Views
    PeterJonesP

    For future readers, the discussion continues in another Topic.

    (In general, it’s advised that clarifications of the same question be made in the same Topic, but since the discussion continued there, there’s not much we can do about it in this instance.)

  • Type is all caps only, how to change

    4
    0 Votes
    4 Posts
    646 Views
    Alan KilbornA

    @dan-wilson said in Type is all caps only, how to change:

    big fella

    “Big fella”? LOL
    Hardly, I’m 5’ 8" in the mornings; shorter at bedtime. :-)

  • Np++ no styles when start

    11
    0 Votes
    11 Posts
    701 Views
    Celestin NohaC

    Thanx you all … its working now :) … i didnt do anything … and suddenly its ok … maybe its relate with corrupted ram which i change today … many thanx again

  • How can I delete all rows before or after my current line?

    8
    0 Votes
    8 Posts
    24k Views
    Enno DünkelE

    @PeterJones: That 2 shortcuts work best for me - I don’t just want to keep the cursorline.
    Sorry for my stupid question - thread is solved. And the solution is very simple…
    Thanks a lot!

  • Conditional read of fileshares

    2
    0 Votes
    2 Posts
    170 Views
    PeterJonesP

    @Roland-Bengtsson ,

    There is a checkbox in the preferences which determines whether or not you want Notepad++ to check for the existence of files from the MRU (Most Recently Used list) at launch time. Unfortunately for you, that does not apply to open tabs.

    Basically, Notepad++ always wants to load the bytes from the file for any tabs open in the current session. Doing “just in time” reading of the file (when that tab is activated) would likely require a significant rewrite of the codebase… but I could be wrong. If you go into the FAQ section of this forum, you’ll see a post “FAQ Desk: Feature Request or Bug Report”, which will explain where and how to make a feature request. If you submit a feature request, understand that it might not be implemented. If you submit a feature request for this idea, it would be considered polite to grab a link to that request and put it in this topic, so future readers of this topic can track what happened to that request.

  • How to automate EOL conversion for live data feed

    2
    0 Votes
    2 Posts
    801 Views
    dinkumoilD

    @A-Former-User

    To use Notepad++ (or any other texteditor) for batch-conversion of EOL format is the wrong approach. Use a command line tool instead.

    For example, have a look at https://waterlan.home.xs4all.nl/dos2unix.html

  • Find previous doesn't work

    4
    0 Votes
    4 Posts
    1k Views
    Alan KilbornA

    @Steven123 said in Find previous doesn't work:

    Do you have an example of a regex that doesn’t behave as expected when searching in reverse?

    I did some research and it appears the logic for disabling the feature was that certain regex do not produce the same matches when moving forward through a series of different matches as is produced when moving backward through the same text.

    It was deemed desirable from a user perspective to produce the same hits moving in either direction (otherwise users would put in bugs about this).

    The example cited was this one:

    find: t\w+

    on this text: to the test they travelled

    which, if you try an older version of Notepad++ where backward searches were allowed, it does indeed produces different results.

  • FTP problems

    7
    0 Votes
    7 Posts
    439 Views
    Pizza GarnieP

    A huge THANK YOU. Your video SOLVED my problem.

    (after adding the new record, we have to make a selection at the automatically addes line BEFORE pressing the close buuton. A terrible choice of double form editing on the same sreen. Withyout changing this dicutable way of doing, at least, making the automatic selection AT THE SAME TIME the automatically added line would be better).

    (not important : “Global cache” is in the global setting)

    Thank’s again. All is now OK.

  • The search and replace mode is broken?

    2
    0 Votes
    2 Posts
    272 Views
    Alan KilbornA

    @Al-___ said in The search and replace mode is broken?:

    but in the last one it is definitely broken.

    Maybe something else is broken.

    There is a text, I make a selection in it, and I look for the selected piece.

    That is a bit vague; can you be more specific?

    Assume you did this:

    select some text with one or more spaces in it go to Find window put a space character in the Find what box tick In selection checkbox press the Find All in Current Document button observe no hits in Find result window

    Is that right? If not, can you try that sequence?

    Hint: If I try that sequence with the Match whole word only checkbox ticked, I get no hits; otherwise I do get hits, so…see if that checkbox is ticked for you or not.

  • Is there a similar functionality? Hint for convolution groups.

    4
    0 Votes
    4 Posts
    1k Views
    TroshinDVT

    @Alan-Kilborn When you move the mouse pointer to the folding line, a popup pops up with the first and last line of the folding zone, demonstration:
    alt text

    this allows you to see the headers of hidden loops (for, while, etc.) and ifs.
    Is there such functionality, for example, a plugin?

  • How to return values against a certain Parameter

    6
    0 Votes
    6 Posts
    565 Views
    PeterJonesP

    ^.+File Number =|^.+D=
    Issue resolved.

    @Annin-Jacob,

    I am glad you got it working.

    However, there were no equal signs = in the example data you gave us, so it is impossible for the regular expression to have worked with the data you gave us. Either the data you gave us doesn’t match the data you used it on, or you have not given us the actual regular expression that really worked for you, or the forum has badly mangled one or both because you didn’t use the </> button in the forum to format your data and regex. In any of those cases, it would have been impossible for us to properly help you.

    I make this post, not because I expect @Annin-Jacob to ever come back and read any more here – though if they do, I hope they learn from this advice – but because I am hoping that other people who read this site will take this advice as an example of why it’s so important to give reasonable example data, and to use the formatting available in the forum to make sure to properly display the example text exactly as it’s pasted in.

    ----

    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 clipboard 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.

  • Regex to match spaces in a URL

    3
    0 Votes
    3 Posts
    1k Views
    guy038G

    Hello, @progonkpa and All,

    I suppose that the following regex S/R sould do the job !

    SEARCH (?-is)(?:<img\x20+src="\K|\G)(?:\x20*([^"\x20\r\n]+)|\x20+)

    REPLACE \1

    Remarks :

    Due to the \G syntax, the initial location of the cursor must not be followed with space characters

    Tick the Wrap around option

    Select the Regular expression search mode

    Because of the \K syntax, click on the Replace All button, exclusively. ( Do not use the Replace button ! )

    Notes :

    If we use the Free-spacing mode (?x), this regex can be expressed as : (?x-is) (?: <img \x20+ src=" \K | \G ) (?: \x20* ( [^"\x20\r\n]+ ) | \x20+ )

    So the regex engine is looking for a string <img src=", first, with this exact case

    Then , due the \K syntax, anything being matched, so far, is canceled and the regex engine, now, searches, either, for :

    A non-null range of non-space characters, possibly preceded by space chars

    A non-null range of space characters

    Then, due the \G syntax, it searches, for the same ranges, as above, right after the location of the last match. If a match cannot be found, it tries, again, to find an other string <img src=" and so on…

    Note that the (?:...........) structures are non-capturing groups which do not store anything for further use, either, in search and/or replacement !

    In replacement, we only rewrite the non-space characters [^"\x20\r\n]+ stored in group 1

    Best Regards,

    guy038

  • Suddenly cannot type [ in Notepad++

    4
    0 Votes
    4 Posts
    8k Views
    Shrikant ShrinivasS

    Had the same problem today, 07-Dec-2020

    Initially thought there was a problem with the Keyboard, or some gaming settings had come on. But found that it was typing normally in every other program.

    Finally found the problem. It seems that I had accidentally pressed some key combination that had activated a shortcut that made the file Read-Only.

    Fiddling around, found a setting in Edit Menu. And removed the Read only status.

    Everything was normal immediately.

  • Regex for locating a line with two non-consecutive tab characters

    6
    0 Votes
    6 Posts
    500 Views
    Terry RT

    @glossar said in Regex for locating a line with two non-consecutive tab characters:

    I understand you. I, too, do ask askers to try first what they ask.

    I’m sorry if what we said has offended you. But I will reiterate my previous post. We aren’t a free bus service hop on and hop off at will.

    That said, I did offer up a solution for you. All you need to do is convert that into some regexes. My steps are such that these should be easy to code up for someone just learning regex. And if you were to do that and still miss getting what you wanted then show us what you had done. We’d be glad to guide you some more.

    From our point of view if we gave everyone the solutions they want without asking for something in return we’d be inundated with requests. It’s much like the proverb:
    “if you give a hungry man a fish, you feed him for a day, but if you teach him how to fish, you feed him for a lifetime”. My guidance is an attempt at teaching you how to “fish”.

    Terry

  • Regex for deleting a number in a line only if it is the only one

    10
    0 Votes
    10 Posts
    738 Views
    glossarG

    Hi @guy038 and @Terry-R ,

    Thank you both for your subsequent solutions. Alan’s @Alan-Kilborn formula have done the job, so I can’t even reproduce the problem now :P, but I’ll note yours just in case I need it again.

    Thanks again.
    glossar