Home › Forums › C Programming › C Code to extraxct data from a file
- This topic has 1 reply, 2 voices, and was last updated 15 years, 11 months ago by GWILouisaxwzkla.
- AuthorPosts
- December 25, 2008 at 12:54 am #2172CandraU83dParticipant
Hi all,
I have sorted some data into a file say output.txt. I need to get only the fields highlited in red into a file. Can some one help me with the code for the same
Training File = .ts_ce_D_0.5-1.5_train3.sdf
Training episode halted at max. epoch 100.
Final Accuracy = 100.00 100.00 100.00
TEST SET ts_ce_D_0.5-1.5_test3.sdf: Results on epoch 100
Final Accuracy = 100.00 100.00 100.00
TEST SET ts_ce_D_-10000.0–0.5_test3.sdf: Results on epoch 100
Final Accuracy = 39.37 95.94 68.68
TEST SET ts_ce_D_-0.5-0.5_test3.sdf: Results on epoch 100
Final Accuracy = 95.55 98.23 96.91
TEST SET ts_ce_D_0.5-1.5_test3.sdf: Results on epoch 100
Final Accuracy = 100.00 100.00 100.00
TEST SET ts_ce_D_1.5-10000.0_test3.sdf: Results on epoch 100
Final Accuracy = 100.00 100.00 100.00
TEST SET ts_ce_test3.sdf: Results on epoch 100
Final Accuracy = 89.45 98.47 94.01Can someone please help me with teh C code to extract the pattern in RED from the file that i have given.
Regards
Subbu - December 30, 2008 at 9:41 pm #3504GWILouisaxwzklaParticipant
Is the code to be in c or c++? If in C++ you could easily type the proper combinations of input ( for the first line for example ):
123456<br />inputFile >> word; //get "Training"<br />inputFile >> word;//get "File"<br />inputFile >> word// get "="<br />inputFile.getline ( fileString , MAX_LENGTH , 'n' ); //get ".ts_ce_D_0.5-1.5_train3.sdf"<br />simple but tedious ………
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.