diff --git a/templates/reorganize.py b/templates/reorganize.py index 7edb3f5..36751ce 100644 --- a/templates/reorganize.py +++ b/templates/reorganize.py @@ -23,7 +23,7 @@ shutil.rmtree('quotes') for quote in quotes: # path: ./quotes/author/work/ - path = 'quotes/' + quote[1] + '/' + quote[3] + '/' + path = 'quotes/' + quote[1] + '/' # https://stackoverflow.com/a/600612/11736197 try: @@ -34,6 +34,7 @@ for quote in quotes: else: raise - with open(path + 'quotes.csv', 'a') as csvfile: - writer = csv.writer(csvfile, delimiter=',', quotechar='`') + # file path: ./quotes/author/title.csv + with open(path + quote[3] + '.csv', 'a') as csvfile: + writer = csv.writer(csvfile, delimiter=',', quotechar='`', quoting=csv.QUOTE_ALL) writer.writerow(quote) \ No newline at end of file