| | |
extracting data from a string
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2007
Posts: 35
Reputation:
Solved Threads: 0
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++.
------------------------------------------------------------------------------------------------------
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++.
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...
![]() |
Similar Threads
- PHP HTTP Screen-Scraping Class with Caching (PHP)
- Handling Notepad By Visual Basic 6.0 (Visual Basic 4 / 5 / 6)
- Extracting fields from text file containing raw data.. (C)
- Reading binary file and trying to set Type as Short (Visual Basic 4 / 5 / 6)
- Reading data from SQL (Visual Basic 4 / 5 / 6)
- modify txt file (C++)
- notepad manipulation (Visual Basic 4 / 5 / 6)
- extracting an arbitrary number of numbers from a string (C)
- read a file (Perl)
- Zend PHP Certification (PHP)
Other Threads in the C++ Forum
- Previous Thread: Database conectivity with c++
- Next Thread: WinAPI: UpdateResource size limit?
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






