Multiple selection in mixed paragraph



  • Hello to everyone.

    I have a text document and it has a specific structure that starts with a word that repeats itself paragraph by paragraph. The particular structure (XXXX " ) I’m talking about has this form, except for the parentheses. It’s always the same word and quotation marks, followed by several different words that are not alike. There are different lines in between. So I have to skip those different lines and select all the remaining lines in one go. How I can?

    Thanks in advance…



  • @darkenb ,

    If you use Search > Mark, and enable Bookmark line, search for XXXXX " , which will bookmark each of the lines. Then use Search > Bookmark > … to perform bulk operations on each of the bookmarked lines, like copy or delete or navigate between



  • But then only XXXX " selects this word. However, I want every line that starts with that word to be selected. XXXX “This content is different in every line” is my document with this structure. It goes on like this on every line, but there are different lines between them.



  • @darkenb said in Multiple selection in mixed paragraph:

    But then only XXXX " selects this word. However, I want every line that starts with that word to be selected. XXXX “This content is different in every line” is my document with this structure. It goes on like this on every line, but there are different lines between them.

    30341e07-0206-4c29-80d0-89e0257103a9-image.png

    it only marks (the peachy background) the prefix. But the bookmark (the blue circle) applies to the whole line. If I then do Search > Bookmark > Copy Bookmarked Lines, it puts the whole line into the copy buffer. For example, I did that, and now am pasting it into my reply:

    XXXXX "Something goes here
    XXXXX "Something goes here
    XXXXX "Something goes here
    XXXXX "Something goes here
    XXXXX "Something goes here
    XXXXX "Something goes here
    XXXXX "Something goes here
    XXXXX "Something goes here
    

    Notice that it got the whole line, not just the highlighted text.

    You never said what you wanted to do with the result, which can determine the best way to answer you. Since you gave minimal information, I gave you what I thought was the best match for what you seemed to be asking, and the most flexible, since you didn’t say whether you wanted to search-and-replace, or be able to easily navigate, or get ready to copy those lines, or what – and the solution I gave you is quite flexible.

    If you are planning on doing a search-and-replace, such that it matters whether the whole line is in the “matched” portion or not, then use the Search > Replace dialog, find XXXXX ".*, replace with whatever you want, and use search mode = regular expression, with “. matches newline” turned off.

    ----

    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 literal text using the </> toolbar button or manual Markdown syntax. To make regex in red (and so they keep their special characters like *), use backticks, like `^.*?blah.*?\z`. 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.



  • I am Turkish and do not speak English. That’s why I open a topic here with Google translate and communicate. I apologize if there is a problem with translations or words.

    If I need to explain my question in detail, let me explain.

    I’m translating a game. I will translate simple words but I need to translate at least 1500 lines. A copy of the content I will translate is in the image below.

    alt text

    I’ll just translate lines that start like (msgid “XXX”). So I just want to select all these lines and copy them to a separate place. Since each line starts with the same word + space + quotation mark, I thought it would be easy to select these lines. The problem is just that. It is very difficult to select 1500 lines one by one because there are different lines in between.

    I hope the translation and sentence structure is correct this time.



  • @darkenb said in Multiple selection in mixed paragraph:

    I’ll just translate lines that start like (msgid “XXX”). So I just want to select all these lines and copy them to a separate place. Since each line starts with the same word + space + quotation mark,

    If you do the marking operation followed by bookmarked lines copy that Peter describes, what you want should be easy to achieve.

    You’d do the marking operation with this setup:

    0bb70be8-051b-4a3e-b19c-e72e7cf6ed17-image.png

    So that the Find what text is copy/pastable, here it is: ^msgid "



  • It still only selects (msgid ") this part and copies it. I can’t select the rest of that word on any line at once.



  • @darkenb said in Multiple selection in mixed paragraph:

    It still only selects

    Start with:

    4ccde648-8573-470d-b4af-9458dc114cf3-image.png

    Run the marking operation I described, to obtain:

    6f9e9b1b-c0e5-4105-b1d7-4051437d832f-image.png

    Run this menu command:

    eaa40a1e-6ebe-4d35-bc07-16aa4a5ff124-image.png

    Create new tab (press Ctrl+n) and past (Ctrl+v) to obtain:

    05faccee-307f-464a-b854-16d8b53e6a50-image.png

    Is this not the desired result?
    And, this is absolutely no different than Peter’s earlier advice.



  • @Alan-Kilborn The bookmark menu worked. It’s exactly what I wanted, thanks…


Log in to reply