single long line searching2019 Community Moderator Electionawk one single lineString pattern searchingSearching out a pattern from LogsConvert multilines to single lineGrep on single linegrep syntax for searching strings with single-quotes?Searching for only single words in UnixUsing 'find' then searching each line for two values in bash scriptsearching letters in one line using grep and wcgrep stringset as a single line

Integral Notations in Quantum Mechanics

Should I warn new/prospective PhD Student that supervisor is terrible?

Giving feedback to someone without sounding prejudiced

Why does the Persian emissary display a string of crowned skulls?

Pre-Employment Background Check With Consent For Future Checks

Grepping string, but include all non-blank lines following each grep match

Check if object is null and return null

Unable to disable Microsoft Store in domain environment

Does Doodling or Improvising on the Piano Have Any Benefits?

Usage of an old photo with expired copyright

Anime with legendary swords made from talismans and a man who could change them with a shattered body

Is there a reason to prefer HFS+ over APFS for disk images in High Sierra and/or Mojave?

Why is the principal energy of an electron lower for excited electrons in a higher energy state?

What should be the ideal length of sentences in a blog post for ease of reading?

El Dorado Word Puzzle II: Videogame Edition

How to reduce predictors the right way for a logistic regression model

How do I prevent inappropriate ads from appearing in my game?

Why do Radio Buttons not fill the entire outer circle?

Do people actually use the word "kaputt" in conversation?

Why is participating in the European Parliamentary elections used as a threat?

Given this phrasing in the lease, when should I pay my rent?

Isometric embedding of a genus g surface

How to make money from a browser who sees 5 seconds into the future of any web page?

PTIJ: Which Dr. Seuss books should one obtain?



single long line searching



2019 Community Moderator Electionawk one single lineString pattern searchingSearching out a pattern from LogsConvert multilines to single lineGrep on single linegrep syntax for searching strings with single-quotes?Searching for only single words in UnixUsing 'find' then searching each line for two values in bash scriptsearching letters in one line using grep and wcgrep stringset as a single line










0















I have a large document that is only 1 line, it spans multiple pages of vi.



Below is an extract of a small bit, I'm seeking to show text after aria-label="



I would then like to stop at aria-selected=



This would repeat many times along that single line and might contain more than one name.



Anyone able to assist with this - I wondered about breaking the file up in to multiple lines with aria-label= as the line break marker and then grepping the lines.



There is always going to be a number after the aria-label= so that might help remove other matches?



style="background-color: #0B8043;"></div>Spike Bird</div></div></div></div></div></div></div></div></div><div role="rowgroup"><div role="row"><div id="docs-revisions-sidebar-date-group-1551364837014" class="docs-revisions-sidebar-date-group" role="heading">February</div></div><div class="docs-revisions-collapsible-pane" role="presentation"><div class="docs-revisions-collapsible-pane-milestone-tile-container" role="presentation"><div class="docs-revisions-tile" role="row" aria-level="1" aria-expanded="false" id=":oj" aria-label="28 February, 14:40 Joe Bloggs" aria-selected="false"><div class="docs-revisions-tile-content-wrapper" role="presentation"><div class="docs-revisions-tile-header" role="gridcell"><div class="docs-revisions-icon docs-revisions-tile-arrow-button" data-tooltip="Expand detailed versions" aria-label="Expand detailed versions" data-tooltip-offset="-3" data-tooltip-unhoverable="true" role="button" aria-expanded="false" style="user-select: none;"><div class="docs-revisions-icon-img-mask"><div class="docs-revisions-icon-img docs-revisions-icon-arrow"></div></div></div><textarea class="docs-revisions-tile-text-box docs-revisions-tile-text-box-disabled" id=":og" spellcheck="false" rows="1" maxlength="80" 









share|improve this question



















  • 2





    Is the document a well formed XML document?

    – Kusalananda
    20 hours ago















0















I have a large document that is only 1 line, it spans multiple pages of vi.



Below is an extract of a small bit, I'm seeking to show text after aria-label="



I would then like to stop at aria-selected=



This would repeat many times along that single line and might contain more than one name.



Anyone able to assist with this - I wondered about breaking the file up in to multiple lines with aria-label= as the line break marker and then grepping the lines.



There is always going to be a number after the aria-label= so that might help remove other matches?



style="background-color: #0B8043;"></div>Spike Bird</div></div></div></div></div></div></div></div></div><div role="rowgroup"><div role="row"><div id="docs-revisions-sidebar-date-group-1551364837014" class="docs-revisions-sidebar-date-group" role="heading">February</div></div><div class="docs-revisions-collapsible-pane" role="presentation"><div class="docs-revisions-collapsible-pane-milestone-tile-container" role="presentation"><div class="docs-revisions-tile" role="row" aria-level="1" aria-expanded="false" id=":oj" aria-label="28 February, 14:40 Joe Bloggs" aria-selected="false"><div class="docs-revisions-tile-content-wrapper" role="presentation"><div class="docs-revisions-tile-header" role="gridcell"><div class="docs-revisions-icon docs-revisions-tile-arrow-button" data-tooltip="Expand detailed versions" aria-label="Expand detailed versions" data-tooltip-offset="-3" data-tooltip-unhoverable="true" role="button" aria-expanded="false" style="user-select: none;"><div class="docs-revisions-icon-img-mask"><div class="docs-revisions-icon-img docs-revisions-icon-arrow"></div></div></div><textarea class="docs-revisions-tile-text-box docs-revisions-tile-text-box-disabled" id=":og" spellcheck="false" rows="1" maxlength="80" 









share|improve this question



















  • 2





    Is the document a well formed XML document?

    – Kusalananda
    20 hours ago













0












0








0








I have a large document that is only 1 line, it spans multiple pages of vi.



Below is an extract of a small bit, I'm seeking to show text after aria-label="



I would then like to stop at aria-selected=



This would repeat many times along that single line and might contain more than one name.



Anyone able to assist with this - I wondered about breaking the file up in to multiple lines with aria-label= as the line break marker and then grepping the lines.



There is always going to be a number after the aria-label= so that might help remove other matches?



style="background-color: #0B8043;"></div>Spike Bird</div></div></div></div></div></div></div></div></div><div role="rowgroup"><div role="row"><div id="docs-revisions-sidebar-date-group-1551364837014" class="docs-revisions-sidebar-date-group" role="heading">February</div></div><div class="docs-revisions-collapsible-pane" role="presentation"><div class="docs-revisions-collapsible-pane-milestone-tile-container" role="presentation"><div class="docs-revisions-tile" role="row" aria-level="1" aria-expanded="false" id=":oj" aria-label="28 February, 14:40 Joe Bloggs" aria-selected="false"><div class="docs-revisions-tile-content-wrapper" role="presentation"><div class="docs-revisions-tile-header" role="gridcell"><div class="docs-revisions-icon docs-revisions-tile-arrow-button" data-tooltip="Expand detailed versions" aria-label="Expand detailed versions" data-tooltip-offset="-3" data-tooltip-unhoverable="true" role="button" aria-expanded="false" style="user-select: none;"><div class="docs-revisions-icon-img-mask"><div class="docs-revisions-icon-img docs-revisions-icon-arrow"></div></div></div><textarea class="docs-revisions-tile-text-box docs-revisions-tile-text-box-disabled" id=":og" spellcheck="false" rows="1" maxlength="80" 









share|improve this question
















I have a large document that is only 1 line, it spans multiple pages of vi.



Below is an extract of a small bit, I'm seeking to show text after aria-label="



I would then like to stop at aria-selected=



This would repeat many times along that single line and might contain more than one name.



Anyone able to assist with this - I wondered about breaking the file up in to multiple lines with aria-label= as the line break marker and then grepping the lines.



There is always going to be a number after the aria-label= so that might help remove other matches?



style="background-color: #0B8043;"></div>Spike Bird</div></div></div></div></div></div></div></div></div><div role="rowgroup"><div role="row"><div id="docs-revisions-sidebar-date-group-1551364837014" class="docs-revisions-sidebar-date-group" role="heading">February</div></div><div class="docs-revisions-collapsible-pane" role="presentation"><div class="docs-revisions-collapsible-pane-milestone-tile-container" role="presentation"><div class="docs-revisions-tile" role="row" aria-level="1" aria-expanded="false" id=":oj" aria-label="28 February, 14:40 Joe Bloggs" aria-selected="false"><div class="docs-revisions-tile-content-wrapper" role="presentation"><div class="docs-revisions-tile-header" role="gridcell"><div class="docs-revisions-icon docs-revisions-tile-arrow-button" data-tooltip="Expand detailed versions" aria-label="Expand detailed versions" data-tooltip-offset="-3" data-tooltip-unhoverable="true" role="button" aria-expanded="false" style="user-select: none;"><div class="docs-revisions-icon-img-mask"><div class="docs-revisions-icon-img docs-revisions-icon-arrow"></div></div></div><textarea class="docs-revisions-tile-text-box docs-revisions-tile-text-box-disabled" id=":og" spellcheck="false" rows="1" maxlength="80" 






awk grep






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 18 hours ago









Rui F Ribeiro

41.6k1483141




41.6k1483141










asked 20 hours ago









Terry Bradford StaffTerry Bradford Staff

1




1







  • 2





    Is the document a well formed XML document?

    – Kusalananda
    20 hours ago












  • 2





    Is the document a well formed XML document?

    – Kusalananda
    20 hours ago







2




2





Is the document a well formed XML document?

– Kusalananda
20 hours ago





Is the document a well formed XML document?

– Kusalananda
20 hours ago










2 Answers
2






active

oldest

votes


















0














Try this,



grep -Po '(?<=(aria-label=")).*(?=" aria-selected=)' file


it prints the value between aria-label=" and " aria-selected=






share|improve this answer
































    0














    I know that OP asked for either awk or grep based answers. Also @msp9011 's answer with its Perl regex is perfectly correct. As a reference, here is the sed version for all it's worth:



    $ sed 's/^.*aria-label="(.*)" aria-selected=.*$/1/g' filename


    It also prints the valueS between aria-label=" and " aria-selected= including when there is more than one occurrence of the regex on one line.






    share|improve this answer






















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507387%2fsingle-long-line-searching%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Try this,



      grep -Po '(?<=(aria-label=")).*(?=" aria-selected=)' file


      it prints the value between aria-label=" and " aria-selected=






      share|improve this answer





























        0














        Try this,



        grep -Po '(?<=(aria-label=")).*(?=" aria-selected=)' file


        it prints the value between aria-label=" and " aria-selected=






        share|improve this answer



























          0












          0








          0







          Try this,



          grep -Po '(?<=(aria-label=")).*(?=" aria-selected=)' file


          it prints the value between aria-label=" and " aria-selected=






          share|improve this answer















          Try this,



          grep -Po '(?<=(aria-label=")).*(?=" aria-selected=)' file


          it prints the value between aria-label=" and " aria-selected=







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 19 hours ago

























          answered 20 hours ago









          msp9011msp9011

          4,44344167




          4,44344167























              0














              I know that OP asked for either awk or grep based answers. Also @msp9011 's answer with its Perl regex is perfectly correct. As a reference, here is the sed version for all it's worth:



              $ sed 's/^.*aria-label="(.*)" aria-selected=.*$/1/g' filename


              It also prints the valueS between aria-label=" and " aria-selected= including when there is more than one occurrence of the regex on one line.






              share|improve this answer



























                0














                I know that OP asked for either awk or grep based answers. Also @msp9011 's answer with its Perl regex is perfectly correct. As a reference, here is the sed version for all it's worth:



                $ sed 's/^.*aria-label="(.*)" aria-selected=.*$/1/g' filename


                It also prints the valueS between aria-label=" and " aria-selected= including when there is more than one occurrence of the regex on one line.






                share|improve this answer

























                  0












                  0








                  0







                  I know that OP asked for either awk or grep based answers. Also @msp9011 's answer with its Perl regex is perfectly correct. As a reference, here is the sed version for all it's worth:



                  $ sed 's/^.*aria-label="(.*)" aria-selected=.*$/1/g' filename


                  It also prints the valueS between aria-label=" and " aria-selected= including when there is more than one occurrence of the regex on one line.






                  share|improve this answer













                  I know that OP asked for either awk or grep based answers. Also @msp9011 's answer with its Perl regex is perfectly correct. As a reference, here is the sed version for all it's worth:



                  $ sed 's/^.*aria-label="(.*)" aria-selected=.*$/1/g' filename


                  It also prints the valueS between aria-label=" and " aria-selected= including when there is more than one occurrence of the regex on one line.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 8 hours ago









                  CbhiheCbhihe

                  3971518




                  3971518



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507387%2fsingle-long-line-searching%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                      Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                      Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.