B
Bill Wayne
Hi,
I'm trying to figure out a way to convert some Dungeons and Dragons
treasure lists into bracketed numbers. For example:
01-18 - - Protection +1
19-28 - - Feather falling
Should be converted to:
[18] Protection +1
[10] Feather Falling
I'm trying to do this by opening up a text file with an fstream
function, then move it to the first hyphen. It should read the number
after it and subtract that from the number before it, then add one. The
fstream will then put it into another text file. Note that the large
dashes after the first number range could be a second number range. All
of ranges in the second column would go in their own list, and ditto
with the third.
The problem I'm having is that I just don't have a good way to do the
proper reading. I've messed around with characters, but that didn't
work. What would be a good way to do this, and/or is there a better
way?
On a related sidenote, how do I get the computer to open the text path
a user types in? I haven't had much luck on this one, either.
Help with either question will be appreciated.
Bill
I'm trying to figure out a way to convert some Dungeons and Dragons
treasure lists into bracketed numbers. For example:
01-18 - - Protection +1
19-28 - - Feather falling
Should be converted to:
[18] Protection +1
[10] Feather Falling
I'm trying to do this by opening up a text file with an fstream
function, then move it to the first hyphen. It should read the number
after it and subtract that from the number before it, then add one. The
fstream will then put it into another text file. Note that the large
dashes after the first number range could be a second number range. All
of ranges in the second column would go in their own list, and ditto
with the third.
The problem I'm having is that I just don't have a good way to do the
proper reading. I've messed around with characters, but that didn't
work. What would be a good way to do this, and/or is there a better
way?
On a related sidenote, how do I get the computer to open the text path
a user types in? I haven't had much luck on this one, either.
Help with either question will be appreciated.
Bill