View Single Post
Old Mar 31st, 2008, 3:17 PM   #2
Freaky Chris
Professional Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 447
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: C++ file sorting

Perhaps you could read the file line by line, and then split the string and store each value into and array, this way you can then access each value and say store it into an array for each coloumn. Checking for white space is a good way to know where to split your string. This may be helpful to you as to how you can cut the string. Also combine this with white space checking and you should have a solution to your problem.

Chris
__________________
Steven Skiena - Algorithms

,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],
brainf**k -- It's such a pretty language
Freaky Chris is online now   Reply With Quote