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
Post a Comment