26 lines
643 B
Python
Executable File
26 lines
643 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
import csv
|
|
|
|
# Strip whitespace left and right of a string
|
|
def strip(s: str):
|
|
return s.rstrip().lstrip()
|
|
|
|
def main():
|
|
filepaths = sys.argv[1:]
|
|
print(f'{filepaths=}')
|
|
|
|
delim=','
|
|
quotechar='"'
|
|
|
|
for file in filepaths:
|
|
with open(file, newline='') as csvfile:
|
|
reader = csv.reader(csvfile, delimiter=delim, quotechar=quotechar, skipinitialspace=True)
|
|
next(reader) # Skip the first row
|
|
for row in reader:
|
|
stripped = map(strip, row)
|
|
[keyword, text, sound] = stripped
|
|
print(keyword, text, sound)
|
|
main()
|