How can I turn csv file row column value into (row, column, value) in Python -


for example, read 3x3 csv file.

       01   02   03  01 | 11 | 22 | 33 |  02 | 44 | 55 | 66 |  03 | 77 | 88 | 99 | 

then ,i want output new textfile photo.

→ (row, column, value)  → (01, 01, 11)  → (01, 02, 22)  → (01, 03, 33)  → (02, 01, 44) 

i want use python array or loop ~~

like ~

for x in range(len(row)) 

suppose have example.csv file this:

11|22|33 44|55|66 77|88|99 

with open("example.csv") handler:     r,l in enumerate(handler):         col, e in enumerate(l.split('|')):             print('row: %s, col %s, value: %s' % (r+1, col+1, e)) 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -