This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| docu:csheet:sysadm:script:python:read_csv [2020/07/08 08:05] – admin | docu:csheet:sysadm:script:python:read_csv [2022/01/05 13:48] (current) – admin | ||
|---|---|---|---|
| Line 31: | Line 31: | ||
| if first: | if first: | ||
| for field in row: | for field in row: | ||
| - | # replace everything that is not [a-zA-Z0-9] or _ to ' | + | # replace everything that is not the < |
| # and also convert the field to lowercase | # and also convert the field to lowercase | ||
| - | fields.append(re.sub(r' | + | fields.append(re.sub(r' |
| + | first = False | ||
| else: | else: | ||
| i = 0 | i = 0 | ||
| Line 45: | Line 46: | ||
| i += 1 | i += 1 | ||
| data.append(item) | data.append(item) | ||
| - | first = False | ||
| return data | return data | ||
| return [] | return [] | ||
| </ | </ | ||