I'm successfully adding rows via a Python script to an external .txt file, creating this format:

```
Mike 200 -7 20.0
Dave 200 8 20.0
Andy 200 0 20.0
Mary 100 0 20.0
Mary 100 1 20.0
Jane 200 -7 20.0
Mike 200 -7 20.0
Fred 200 2 20.0
Malcolm 100 -26 20.0
Mike 20 -10 10.0
Mike 200 -10 20.0
Mike 200 -7 20.0
Mike 200 2 20.0
Fred 100 19 20.0
Mike 200 -19 20.0
Jane 200 -7 20.0
Jane 100 -26 20.0
Malcolm 200 -15 20.0

```

I now need to construct a loop in my main python file that will sum the final column based on the first name (first column) e.g. Mike should equal 130, Dave should equal 20, Mary should equal 40, Jane should equal 60 etc

In trying to break down the problem, I thought I'd manually test one name to start with (using `v`) and have got this far

```
vol_amount = ""
with open("MyTest.txt", "r") as vol:
    for v in vol:
        v = "Mike"
        for s in v[0]:
            vol_amount += int(s[3])

print(vol_amount)

```

I can't seem to get past this point.

Can anyone give any pointers as to what my for loop should be to loop through each of the names in turn, summing up their values from the fourth column? Ideally without using pandas or any add-ons.

I'm sure a for loop can do this.

Thanks