No great trick to it; you just have to think about how you'd do it yourself and then turn that into an algorithm.
Something like:
1) Start looking at string, one character at a time. Start at end of string and work backwards, so that you'll know when you're scanning a percentage (assuming that percentages are of the form xx%).
2) If character is a comma, hyphens or period, copy to file.
3) If character is a percentage or a number, scan further until found all the character making up that percentage or number and copy to file.
4) Keep going until all characters examined.
Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117