-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7986755
commit 705d005
Showing
6 changed files
with
860 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
"filter for grantsmonthly.csv" | ||
|
||
import csv | ||
import sys | ||
|
||
REMOVE_COLUMNS = [ | ||
'record_created', | ||
'record_modified', | ||
'user_modified', | ||
] | ||
|
||
def main(): | ||
reader = csv.DictReader(sys.stdin) | ||
outnames = [f for f in reader.fieldnames if f not in REMOVE_COLUMNS] | ||
writer = csv.DictWriter(sys.stdout, outnames) | ||
writer.writeheader() | ||
for row in reader: | ||
try: | ||
for rem in REMOVE_COLUMNS: | ||
del row[rem] | ||
writer.writerow(row) | ||
except ValueError: | ||
pass | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.