User Tools

Site Tools


docu:csheet:sysadm:script:python:read_csv

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next 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:47]
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 <regex>
                     # and also convert the field to lowercase                     # and also convert the field to lowercase
-                    fields.append(re.sub(r'[^\w]+', '_', field.lower()))+                    fields.append(re.sub(r'[^\w\.\-]+', '_', field.lower()))
             else:             else:
                 i = 0                 i = 0
docu/csheet/sysadm/script/python/read_csv.txt · Last modified: 2022/01/05 13:48 by admin