Print only the lines that have specific properties

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












LlI have a text file i want to separate the output in one command as below:



  1. Print all lines that have all repeated characters.

  2. Print all lines with all repeated characters except the last one or the last two characters in the same line.

  3. Print all lines with all repeated characters except the first one or the first two characters in the same line.

Example:



1112266 
44778
223334456
6778811
845511
3357788


The output should be



1112266 >>>>> All repeated characters. 
44778 >>>>> All repeated except the last character.
223334456 >>> All repeated except the last two characters
6778811 >>>> All repeated except the first character.
845511 >>>> All repeated except the first two characters.








share



























    up vote
    0
    down vote

    favorite












    LlI have a text file i want to separate the output in one command as below:



    1. Print all lines that have all repeated characters.

    2. Print all lines with all repeated characters except the last one or the last two characters in the same line.

    3. Print all lines with all repeated characters except the first one or the first two characters in the same line.

    Example:



    1112266 
    44778
    223334456
    6778811
    845511
    3357788


    The output should be



    1112266 >>>>> All repeated characters. 
    44778 >>>>> All repeated except the last character.
    223334456 >>> All repeated except the last two characters
    6778811 >>>> All repeated except the first character.
    845511 >>>> All repeated except the first two characters.








    share

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      LlI have a text file i want to separate the output in one command as below:



      1. Print all lines that have all repeated characters.

      2. Print all lines with all repeated characters except the last one or the last two characters in the same line.

      3. Print all lines with all repeated characters except the first one or the first two characters in the same line.

      Example:



      1112266 
      44778
      223334456
      6778811
      845511
      3357788


      The output should be



      1112266 >>>>> All repeated characters. 
      44778 >>>>> All repeated except the last character.
      223334456 >>> All repeated except the last two characters
      6778811 >>>> All repeated except the first character.
      845511 >>>> All repeated except the first two characters.








      share















      LlI have a text file i want to separate the output in one command as below:



      1. Print all lines that have all repeated characters.

      2. Print all lines with all repeated characters except the last one or the last two characters in the same line.

      3. Print all lines with all repeated characters except the first one or the first two characters in the same line.

      Example:



      1112266 
      44778
      223334456
      6778811
      845511
      3357788


      The output should be



      1112266 >>>>> All repeated characters. 
      44778 >>>>> All repeated except the last character.
      223334456 >>> All repeated except the last two characters
      6778811 >>>> All repeated except the first character.
      845511 >>>> All repeated except the first two characters.






      command-line





      share














      share












      share



      share








      edited 12 secs ago









      Kusalananda

      109k14213336




      109k14213336










      asked 2 mins ago









      Ahmed

      454




      454

























          active

          oldest

          votes











          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f475315%2fprint-only-the-lines-that-have-specific-properties%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475315%2fprint-only-the-lines-that-have-specific-properties%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?