![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read a file line by line | VENC22 | UNIX for Dummies Questions & Answers | 4 | 10-30-2008 11:09 AM |
| read the file line by line | kittusri9 | Shell Programming and Scripting | 3 | 04-24-2008 09:26 AM |
| How to read last line of a txt file? | yongho | UNIX for Dummies Questions & Answers | 2 | 06-13-2005 02:20 PM |
| read line from file | rein | Shell Programming and Scripting | 5 | 04-15-2005 03:32 AM |
| How to read from a file line by line and do stuff | spaceship | Shell Programming and Scripting | 4 | 03-17-2005 09:47 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to read element of line of file
Hi,
I would like to get elements in data in a file. My file data would be something like:- foo 123.32 323 4356.234 22344.9 fon 234.454 3434 2362.3 34 ...etc.. I would like to read the elements in this file each line by line and write onto another text file. I am using getline to get these data from line by line basis. However, for element basis, I would like to use istream_iterator vector to store these values but im not sure how I could use that since vector only permits one type of data type. Instead, my data has mixture of string, float and ints data. Another alternative im thinking would be using istringstream obj(line) and then declare each element variable's data type before obj>>a>>b>>c>>d>>e But Im not too sure it is working or correct concept. Please help. Thanks. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|