Created
November 26, 2015 11:37
-
-
Save nosajio/32dcf3dd28fa25538db2 to your computer and use it in GitHub Desktop.
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
import csv | |
sourcefile = './src/origin.csv' | |
destinationfile = './dist/https-comments.csv' | |
data = [] | |
print('Opening write file %r' % destinationfile) | |
with open(destinationfile, 'w') as writeFile: | |
writer = csv.writer(writeFile, delimiter=',') | |
print('Opening read file %r' % sourcefile) | |
with open(sourcefile, newline='') as csvfile: | |
disqussrc = csv.reader(csvfile, delimiter=' ', quotechar='|') | |
for row in disqussrc: | |
if 'https://' in row[0]: continue | |
data.append([row[0], row[0].replace('http://', 'https://')]) | |
writer.writerows( data ); | |
print('done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment