LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   [BASH] How to read multiple lines from a text file? (https://www.linuxquestions.org/questions/programming-9/%5Bbash%5D-how-to-read-multiple-lines-from-a-text-file-867902/)

gtirsmiley 03-11-2011 06:06 AM

[BASH] How to read multiple lines from a text file?
 
For example, I have a text file with data which lists numerical values from two separate individuals

Code:

Person A
100
200
300
400
500
600
700
800
900
1000
1100
1200

Person B
1200
1100
1000
900
800
700
600
500
400
300
200
100

How would I go about reading the values for each Person, then being able to perform mathematical equations for each Person (finding the sum for example) ?

Thanks.

XavierP 03-11-2011 06:35 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Continue here: http://www.linuxquestions.org/questions/programming-9/[bash]-how-to-read-multiple-lines-from-a-text-file-867901/


All times are GMT -5. The time now is 01:35 AM.