Reading in delimited files...
-
As you probably noticed from this post I am a very new newbie to VC++. Here is my problem. I need to read in a test file that might have a format like this... string, int, int. I know in java you can use a string tokenizer to read in each value separatly and by line. I can't seem to figure this out in C++. This is what I have been doing. CFile myFile("test.txt", CFile::); BYTE buffer[4096]; CString input; input = myFile.Read(buffer, 4096); Once I get it into a string object I can use the method SpanExcluding to get a string from the beginning to the first character I specify not to read. I can't seem to get past it thought. I know my approach is probably all wrong so I don't care if you tear it to shreads. I frequently visit this site and know you guys know what you;re doing so thanks for any advice in advance. Joshua
-
As you probably noticed from this post I am a very new newbie to VC++. Here is my problem. I need to read in a test file that might have a format like this... string, int, int. I know in java you can use a string tokenizer to read in each value separatly and by line. I can't seem to figure this out in C++. This is what I have been doing. CFile myFile("test.txt", CFile::); BYTE buffer[4096]; CString input; input = myFile.Read(buffer, 4096); Once I get it into a string object I can use the method SpanExcluding to get a string from the beginning to the first character I specify not to read. I can't seem to get past it thought. I know my approach is probably all wrong so I don't care if you tear it to shreads. I frequently visit this site and know you guys know what you;re doing so thanks for any advice in advance. Joshua
Sorry