| dekoperez (5) | |
|
Hello everyone I'm working with a file that contains a huge quantity of numbers. The problem is, I got these numbers from a source code of a website, and its formated like this: <td>07</td> <td>12</td> <td>38</td> <td>39</td> <td>45</td> <td>56</td> To use these numbers in the main program I need to format this file, removing the characters 't','d', '/','<' and '>'. Could this be done using c++ ? It will take like a thousands of years to format this file manually >< | |
|
|
|
| Ogoyant (153) | |
|
Sure it could. If you read the content of the file, looking for "<td>" tags and then storing the content until you reach "</td>", you can store that content in an array or vector and then output it in a new file without the <td> tags (or use it in any other way you want). EDIT: Still, if you just want the numbers without the characters 't','d', '/','<' and '>', and do not intend to use them as input in a program yourself, you could probably do this a lot faster using something like Notepad++ 's "Search and Replace" functions. You could copy the part of the HTML file containing the numbers in a new file, then replace "<td>" with " " (or perhaps no character at all, although I'm not sure whether it's possible), and do the same for "</td>". That would leave just the numbers for you. | |
|
Last edited on
|
|
| dekoperez (5) | |
| Thanks a lot, I didnt know the Notepad++, I'll try it (: | |
|
|
|
| dekoperez (5) | |
| It works :) | |
|
|
|
| Ogoyant (153) | |
|
Great, glad to know : ) Ogoyant | |
|
|
|