It's me again, with for some people here probably an easy thing to code.
I have this txt file, with in it "tags" with a number value that I need to add up all together.
The parts in the txt file that I need look like this:
Quote:
text text text
<segment bytes="100" number="1">some random text</segment>
text random text random text
some more random text
<segment bytes="3397" number="1">some random text</segment>
some other random text
<segment bytes="3521" number="1">some random text</segment>
<segment bytes="261" number="2">some random text</segment>
<segment bytes="9621" number="3">some random text</segment>
some more random text
some more random text
<segment bytes="7" number="1">some text</segment>
even more text
|
So. The code needs to read the value after
<segment bytes=", and add it all together. (it's always on a new line)
The times that
<segment bytes=" is in the file could be one time or many times!
Now. How could I do this the best way?
Any help appreciated!
Recent comments
8 hours 20 min ago
17 hours 47 min ago
18 hours 37 min ago
22 hours 10 min ago
1 day 2 hours ago
1 day 2 hours ago
1 day 5 hours ago
1 day 15 hours ago
1 day 20 hours ago
1 day 21 hours ago