RSS Forums RSS
Please support our C++ advertiser: Programming Forums

how do i parse a custom delimited file

Join Date: Apr 2007
Posts: 10
Reputation: Lance Wassing is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Lance Wassing Lance Wassing is offline Offline
Newbie Poster

Re: how do i parse a custom delimited file

  #7  
Apr 3rd, 2007
Well everyone, i have figured out a way of doing this sort of.

What i have done is created strings, and used the substring function within a huge for loop. This method works better than strtok, mainly because i can't figureout strtok... not quite, but the problem is that, the file must be hard coded intot he executable, but i want to read the file to a string array, and then use the substring function to parse.

I guess my question, and im sorry to ask such a novice question as i am a novice in c, how do i load my file, preferably with the fopen function of stdio.h and stdlib.h, int String arrays?

bassically i would like
String Lines = new String[i]
//Where i is the number of lines in the file
//load the file into the String array so that it //looks like this:
Lines[0] = "Lance , Wassing , 11 Wonderway";
/*
and so on then i can just loop through the array doing the Lines[i].SubString(int, int); function */
if you have something that will work for this purpose, or know i how i can do this, please let me know. Your help is MUCH appreciated!

Thankyou,
Lance
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:53 pm.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC