-
-
Save brianbancroft/8045369 to your computer and use it in GitHub Desktop.
I've played around with the file, learnt a few new things and still am drawing a bit of a blank.
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
fname = 'C:\\Temp\\SIC_Core.txt' | |
ofname = 'C:\\Temp\\SIC_Fixed.txt' | |
with open(fname, 'r') as ifile: | |
input = ifile.readlines(-1) | |
with open(ofname, 'w') as ofile: | |
i = 0 | |
while i < len(input): | |
line = str(input[i]) | |
i = i + 1 | |
next_line = str(input[i]) | |
new_line = '"%s":"%s",\n' %(line.strip('\n'), next_line.strip('\n')) | |
ofile.write(new_line) | |
i = i + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've figured this one out, when I had to revisit it. Very straightforward!