Skip to content

Instantly share code, notes, and snippets.

@nosajio
Created November 26, 2015 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nosajio/32dcf3dd28fa25538db2 to your computer and use it in GitHub Desktop.
Save nosajio/32dcf3dd28fa25538db2 to your computer and use it in GitHub Desktop.
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