-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
$ csvfilter -f 1,2,3 file.csv
Expected:
Output columns 1, 2, and 3 from file.csv for all rows
Actual:
Only outputs columns 1, 2, and 3 from the first row.
It looks like the reason for this is:
fields = map(int, options.fields.split(',')) if options.fields else None
... which is being consumed after the first row:
output = [row[i] for i in self.fields if len(row) > i]
after which self.fields becomes an empty array: []
A solution would be:
fields = list(map(int, options.fields.split(','))) if options.fields else None
This PR should resolve:
#12
technopagan, joaomcarlos, mgalgs, orirawlings, problame and 5 more
Metadata
Metadata
Assignees
Labels
No labels