multiply digits inside numbers based on poition of digit

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











up vote
-1
down vote

favorite












I know this may seem hard but you guys are really bold. I appreciate your help!



I have list of numbers like this



0987656787689
2345453326780
3453212332345
1324532449876
1234532444568
3245321343456
1324354532376
1234532153457


I want results of multiplication of the digits in positions sixth and seventh which are:



56
53
12
32
32
21
54
32


and the multiplication:



30
15
2
6
6
2
20
6








share

























    up vote
    -1
    down vote

    favorite












    I know this may seem hard but you guys are really bold. I appreciate your help!



    I have list of numbers like this



    0987656787689
    2345453326780
    3453212332345
    1324532449876
    1234532444568
    3245321343456
    1324354532376
    1234532153457


    I want results of multiplication of the digits in positions sixth and seventh which are:



    56
    53
    12
    32
    32
    21
    54
    32


    and the multiplication:



    30
    15
    2
    6
    6
    2
    20
    6








    share























      up vote
      -1
      down vote

      favorite









      up vote
      -1
      down vote

      favorite











      I know this may seem hard but you guys are really bold. I appreciate your help!



      I have list of numbers like this



      0987656787689
      2345453326780
      3453212332345
      1324532449876
      1234532444568
      3245321343456
      1324354532376
      1234532153457


      I want results of multiplication of the digits in positions sixth and seventh which are:



      56
      53
      12
      32
      32
      21
      54
      32


      and the multiplication:



      30
      15
      2
      6
      6
      2
      20
      6








      share













      I know this may seem hard but you guys are really bold. I appreciate your help!



      I have list of numbers like this



      0987656787689
      2345453326780
      3453212332345
      1324532449876
      1234532444568
      3245321343456
      1324354532376
      1234532153457


      I want results of multiplication of the digits in positions sixth and seventh which are:



      56
      53
      12
      32
      32
      21
      54
      32


      and the multiplication:



      30
      15
      2
      6
      6
      2
      20
      6






      bash





      share












      share










      share



      share










      asked 4 mins ago









      Koran

      275




      275




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Perl to the rescue!



          perl -F// -lane 'print $F[5] * $F[6]' < file



          • -n reads the input line by line


          • -a splits each line into the @F array


          • -F tells how to split


          • // means to split everywhere, i.e. into single characters


          • -l removes newlines from input and adds them to output




          share




















            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%2f475321%2fmultiply-digits-inside-numbers-based-on-poition-of-digit%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Perl to the rescue!



            perl -F// -lane 'print $F[5] * $F[6]' < file



            • -n reads the input line by line


            • -a splits each line into the @F array


            • -F tells how to split


            • // means to split everywhere, i.e. into single characters


            • -l removes newlines from input and adds them to output




            share
























              up vote
              0
              down vote













              Perl to the rescue!



              perl -F// -lane 'print $F[5] * $F[6]' < file



              • -n reads the input line by line


              • -a splits each line into the @F array


              • -F tells how to split


              • // means to split everywhere, i.e. into single characters


              • -l removes newlines from input and adds them to output




              share






















                up vote
                0
                down vote










                up vote
                0
                down vote









                Perl to the rescue!



                perl -F// -lane 'print $F[5] * $F[6]' < file



                • -n reads the input line by line


                • -a splits each line into the @F array


                • -F tells how to split


                • // means to split everywhere, i.e. into single characters


                • -l removes newlines from input and adds them to output




                share












                Perl to the rescue!



                perl -F// -lane 'print $F[5] * $F[6]' < file



                • -n reads the input line by line


                • -a splits each line into the @F array


                • -F tells how to split


                • // means to split everywhere, i.e. into single characters


                • -l removes newlines from input and adds them to output





                share











                share


                share










                answered 1 min ago









                choroba

                25.1k34269




                25.1k34269



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475321%2fmultiply-digits-inside-numbers-based-on-poition-of-digit%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?