001 00002 0000003 00004 000005 6 000007 008009
------------------------------------------------------------------------------------------------------
GBL UTG.L 0692861 DCGB 000000 0 205750 826UTG
GBL UU.L 0646233 DCGB 000000 0 722501 -371UU.

I have the above data line by line each and coloumn has fixed width then in those i want to assign 9 coloumns to variables reading each line at a time.
Can you pleae help me how the indexing of this is possible in C++.

001 00002 0000003 00004 000005 6 000007 008009
------------------------------------------------------------------------------------------------------
GBL UTG.L 0692861 DCGB 000000 0 205750 826UTG
GBL UU.L 0646233 DCGB 000000 0 722501 -371UU.

I have the above data line by line each and coloumn has fixed width then in those i want to assign 9 coloumns to variables reading each line at a time.
Can you pleae help me how the indexing of this is possible in C++.

Use std::getline(std::iostream&,std::string) function to get data line by line and substr(initial_pos,field_width) std::string member function to extract data fields. Don't forget: starting pos is eq to 0...

I see only 8 columns in your example...

This article has been dead for over six months. Start a new discussion instead.