extract values from text file generated from excel spreadsheets

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











up vote
0
down vote

favorite












I have 500 text files like the one below, I got these files by converting Excel spreadsheets to csv files using ssconvert.



Now, I would like to extract two numbers from these text files, and I can't figure out how? I tried sed and awk with no hope.



I am sure it is very easy for you to help me extract these numbers and I appreciate any support.



quant_param,81200000,1.33E-05,0.00178117,3.82E-07,,Dosagepharmaceutical,,,"Patient weight (lbs)"
,,,,,,"Initial Infusion (ml)",14.87,,140
"Infusion Time",10:40:01,TOF:,10:40:13,"14.23 ml",,"End time",10:39:18,,63502.9318
"Caclulation Time",10:40:01,,,,,,0:00:43,,"Patient Height (in)"
t1,0:00:00,,,,,,43.0000000000035,,60
,0,,,,,"Residual Activity (mCi)",0.18,,1.524


These are part of each file, I would like to learn how to extract number <14.87> from the second line, number <14.23 ml> from the third line and number <1.524> from the last line.










share|improve this question









New contributor




Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I have 500 text files like the one below, I got these files by converting Excel spreadsheets to csv files using ssconvert.



    Now, I would like to extract two numbers from these text files, and I can't figure out how? I tried sed and awk with no hope.



    I am sure it is very easy for you to help me extract these numbers and I appreciate any support.



    quant_param,81200000,1.33E-05,0.00178117,3.82E-07,,Dosagepharmaceutical,,,"Patient weight (lbs)"
    ,,,,,,"Initial Infusion (ml)",14.87,,140
    "Infusion Time",10:40:01,TOF:,10:40:13,"14.23 ml",,"End time",10:39:18,,63502.9318
    "Caclulation Time",10:40:01,,,,,,0:00:43,,"Patient Height (in)"
    t1,0:00:00,,,,,,43.0000000000035,,60
    ,0,,,,,"Residual Activity (mCi)",0.18,,1.524


    These are part of each file, I would like to learn how to extract number <14.87> from the second line, number <14.23 ml> from the third line and number <1.524> from the last line.










    share|improve this question









    New contributor




    Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have 500 text files like the one below, I got these files by converting Excel spreadsheets to csv files using ssconvert.



      Now, I would like to extract two numbers from these text files, and I can't figure out how? I tried sed and awk with no hope.



      I am sure it is very easy for you to help me extract these numbers and I appreciate any support.



      quant_param,81200000,1.33E-05,0.00178117,3.82E-07,,Dosagepharmaceutical,,,"Patient weight (lbs)"
      ,,,,,,"Initial Infusion (ml)",14.87,,140
      "Infusion Time",10:40:01,TOF:,10:40:13,"14.23 ml",,"End time",10:39:18,,63502.9318
      "Caclulation Time",10:40:01,,,,,,0:00:43,,"Patient Height (in)"
      t1,0:00:00,,,,,,43.0000000000035,,60
      ,0,,,,,"Residual Activity (mCi)",0.18,,1.524


      These are part of each file, I would like to learn how to extract number <14.87> from the second line, number <14.23 ml> from the third line and number <1.524> from the last line.










      share|improve this question









      New contributor




      Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have 500 text files like the one below, I got these files by converting Excel spreadsheets to csv files using ssconvert.



      Now, I would like to extract two numbers from these text files, and I can't figure out how? I tried sed and awk with no hope.



      I am sure it is very easy for you to help me extract these numbers and I appreciate any support.



      quant_param,81200000,1.33E-05,0.00178117,3.82E-07,,Dosagepharmaceutical,,,"Patient weight (lbs)"
      ,,,,,,"Initial Infusion (ml)",14.87,,140
      "Infusion Time",10:40:01,TOF:,10:40:13,"14.23 ml",,"End time",10:39:18,,63502.9318
      "Caclulation Time",10:40:01,,,,,,0:00:43,,"Patient Height (in)"
      t1,0:00:00,,,,,,43.0000000000035,,60
      ,0,,,,,"Residual Activity (mCi)",0.18,,1.524


      These are part of each file, I would like to learn how to extract number <14.87> from the second line, number <14.23 ml> from the third line and number <1.524> from the last line.







      text-processing






      share|improve this question









      New contributor




      Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 13 mins ago









      Goro

      9,41464589




      9,41464589






      New contributor




      Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 24 mins ago









      Megan Wise

      1




      1




      New contributor




      Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Megan Wise is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          awk can do this job:



          awk -F',' 'NR==2print $10' file 
          140
          awk -F',' 'NR==3print $5' file
          "14.23 ml"
          awk -F',' 'NR==6print $10' file
          1.524


          If all the 500 files have the same format, meaning they share the same line number, then you can loop these commands over all the files.



          In the comments above, NR represent the line number and -F is the field separator.






          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Megan Wise is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475689%2fextract-values-from-text-file-generated-from-excel-spreadsheets%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













            awk can do this job:



            awk -F',' 'NR==2print $10' file 
            140
            awk -F',' 'NR==3print $5' file
            "14.23 ml"
            awk -F',' 'NR==6print $10' file
            1.524


            If all the 500 files have the same format, meaning they share the same line number, then you can loop these commands over all the files.



            In the comments above, NR represent the line number and -F is the field separator.






            share|improve this answer


























              up vote
              0
              down vote













              awk can do this job:



              awk -F',' 'NR==2print $10' file 
              140
              awk -F',' 'NR==3print $5' file
              "14.23 ml"
              awk -F',' 'NR==6print $10' file
              1.524


              If all the 500 files have the same format, meaning they share the same line number, then you can loop these commands over all the files.



              In the comments above, NR represent the line number and -F is the field separator.






              share|improve this answer
























                up vote
                0
                down vote










                up vote
                0
                down vote









                awk can do this job:



                awk -F',' 'NR==2print $10' file 
                140
                awk -F',' 'NR==3print $5' file
                "14.23 ml"
                awk -F',' 'NR==6print $10' file
                1.524


                If all the 500 files have the same format, meaning they share the same line number, then you can loop these commands over all the files.



                In the comments above, NR represent the line number and -F is the field separator.






                share|improve this answer














                awk can do this job:



                awk -F',' 'NR==2print $10' file 
                140
                awk -F',' 'NR==3print $5' file
                "14.23 ml"
                awk -F',' 'NR==6print $10' file
                1.524


                If all the 500 files have the same format, meaning they share the same line number, then you can loop these commands over all the files.



                In the comments above, NR represent the line number and -F is the field separator.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 9 secs ago

























                answered 17 mins ago









                Goro

                9,41464589




                9,41464589




















                    Megan Wise is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    Megan Wise is a new contributor. Be nice, and check out our Code of Conduct.












                    Megan Wise is a new contributor. Be nice, and check out our Code of Conduct.











                    Megan Wise is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475689%2fextract-values-from-text-file-generated-from-excel-spreadsheets%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?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay