|
-
extracting data from and input file
I'm a newbie to both this forum and to C++. I need to extract various bits of information from an input file. I have no problem setting up to read from the file but I dont fully understand how to get the information I want from it.
It is a simple text file:
-------------------------------------------------------
Feb13-14,2006
Kraushaar,Silke 25 Germany 1:02.517 1:06.339 1:10.249
Huefner,Tatjana 54 Gemany 1:03.969 1:02.134 1:02.19 1:07.660 1:05.372
Zablocki,Courtney 37 UnitedStates 0:59.828 1:00.826 01:11.001 0:54.742
Ludan,Liliya 20 Ukraine 0:62.008 01:09.781 1:07.484 0:58.22
Retrosi,Samantha 42 UnitedStates 01:10.382 0:58.22 1:03.793 1:12.397
Lauscher,Regan 59 Canada
##
---------------------------------------------------------------
I was told I could use strtok_s() to pull pieces from the file. Now I dont fully understand how to use this function. I do understand what tokens and delimators are but I'm not sure how to read say only the times "1:02.517 1:06.339 1:10.249" I can see that they are seperated by spaces but how do i get far enough into the file to read these without picking up all the other information?
I realize this is probably a rudimentary question but I'm not a hardcore programmer by any means and it has been quite a while since I programmed in C. If you could just give me some hints to point me in the right direction I would be very grateful.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks