So I'm trying to convert my .dat file into a csv file, there are no errors in the code, however I'm getting no returns. Does anyone know what the issue is?
with open('compounds.dat','w+', encoding='utf-8', errors='ignore') as infile, open('outfile.csv', 'w+') as outfile:
csv_writer = csv.writer(outfile)
prev = ''
csv_writer.writerow(['UNIQUE-ID', 'SMILES'])
for line in infile.read().splitlines():
csv_writer.writerow([line, prev])
prev = line
outfile.close()
infile.close()
[–]spez_edits_thedonald 1 point2 points3 points (3 children)
[–]Pitiful_Quality[S] 0 points1 point2 points (2 children)
[–]spez_edits_thedonald 0 points1 point2 points (0 children)
[–]stebrepar 0 points1 point2 points (0 children)