LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Closed Thread
 
Search this Thread
Old 03-11-2011, 07:06 AM   #1
gtirsmiley
LQ Newbie
 
Registered: Mar 2011
Posts: 7

Rep: Reputation: 0
[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.
 
Old 03-11-2011, 07:35 AM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
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/
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[BASH] How to read multiple lines from a text file? gtirsmiley Programming 13 03-11-2011 11:18 AM
[SOLVED] edit multiple lines of a text file into 1 line: schneidz Programming 2 04-09-2009 12:22 PM
bash: read multiple lines in a file 300zxkyle Programming 7 07-29-2007 05:38 AM
Read specific lines from a text file chobin Programming 8 06-14-2006 12:14 PM
bash script that can read lines of text palceksmuk Programming 1 12-25-2005 04:49 AM


All times are GMT -5. The time now is 11:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration