Question: This is css

```
li { background: transparent url(bullet-arrow.png) no-repeat left 4px; 
     padding-left: 10px; 
     list-style-image: none; 
     list-style-position: outside; 
     list-style-type: none; }

```

this is current output

[alt text http://shup.com/Shup/382212/11061275219-My-Desktop.png](http://shup.com/Shup/382212/11061275219-My-Desktop.png)

I need in this format

[alt text http://shup.com/Shup/382214/11061275414-My-Desktop.png](http://shup.com/Shup/382214/11061275414-My-Desktop.png)

Answer: 
Something like this should work. It takes an input in the form

```
title,title2,h1,h2,h3
l1.1,l1,1,1,0
l1.2,l1,0,1,0
l1.3,l1,1,0,1
l2.1,l2,0,0,1
l2.2,l2,1,0,1
l3.1,l3,0,1,1
l3.2,l3,1,1,0
l3.3,l3,1,1,0
l3.4,l3,1,1,0

```

and outputs

```
title2,h1,h2,h3
l1,2,2,1
l2,1,0,2
l3,3,4,1

```

Tested with Python 3.1.2. In Python 2.x you'll need to change the `open()` calls to use binary mode, and drop the `newline=""` bit). You can also drop the call to `list()` since in Python 2.x, `map()` already returns a list.

```
import csv
import operator

reader = csv.reader(open("test.csv", newline=""), dialect="excel")
result = {}

for pos, entry in enumerate(reader):
    if pos == 0:
        headers = entry
    else:
        if entry[1] in result:
            result[entry[1]] = list(map(operator.add, result[entry[1]], [int(i) for i in entry[2:]]))
        else:
            result[entry[1]] = [int(i) for i in entry[2:]]

writer = csv.writer(open("output.txt", "w", newline=""), dialect="excel")
writer.writerow(headers[1:])

keys = sorted(result.keys())
for key in keys:
    output = [key]
    output.extend(result[key])
    writer.writerow(output)

```
Have a look at the csv module. What you want to do is open the file with a csv.reader. Then you iterate over the file, one row at the time. You accumulate the results of the additions into a temporary list. When you are done, you write this list to a new csv.writer.

You might need to define a dialect as you are not really using CSV but some tab-delimited format.