-
-
Save yukkeorg/bb8c7ad230e1f17ca9413a90ffa77b14 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
aaaaaaaa bbbbb cccccc dddddddd eeeeee 10/01 10/02 10/03 10/04 10/05 10/06 10/07 10/08 10/09 10/10 10/11 10/12 10/13 10/14 10/15 10/16 10/17 10/18 10/19 10/20 10/21 10/22 10/23 10/24 10/25 10/26 10/27 10/28 10/29 10/30 10/31 11/01 11/02 11/03 11/04 11/05 11/06 11/07 11/08 11/09 11/10 11/11 11/12 11/13 11/14 11/15 11/16 11/17 11/18 11/19 11/20 11/21 11/22 11/23 11/24 11/25 11/26 11/27 11/28 11/29 11/30 | |
00000000 1111111 22222222 ああああああああああああああああああああああああああああああああああああああああああああああ 3 1 × × × × × 1 1 1 1 × × × × 1 1 1 × × × 1 × × × × 1 1 1 1 1 1 × × 1 1 1 1 × 1 1 1 1 1 1 1 × × 1 1 × 1 1 1 × × × 1 1 1 × 1 |
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
aaaaaaaa,bbbbb,cccccc,dddddddd,eeeeee,10/01,10/02,10/03,10/04,10/05,10/06,10/07,10/08,10/09,10/10,10/11,10/12,10/13,10/14,10/15,10/16,10/17,10/18,10/19,10/20,10/21,10/22,10/23,10/24,10/25,10/26,10/27,10/28,10/29,10/30,10/31,11/01,11/02,11/03,11/04,11/05,11/06,11/07,11/08,11/09,11/10,11/11,11/12,11/13,11/14,11/15,11/16,11/17,11/18,11/19,11/20,11/21,11/22,11/23,11/24,11/25,11/26,11/27,11/28,11/29,11/30 | |
00000000,1111111,22222222,ああああああああああああああああああああああああああああああああああああああああああああああ,3,1,×,×,×,×,×,1,1,1,1,×,×,×,×,1,1,1,×,×,×,1,×,×,×,×,1,1,1,1,1,1,×,×,1,1,1,1,×,1,1,1,1,1,1,1,×,×,1,1,×,1,1,1,×,×,×,1,1,1,×,1 |
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
# -*- coding: utf-8 -*- | |
import codecs | |
import sys | |
import csv | |
import re | |
if __name__ == "__main__": | |
fp = open('out.csv.txt', 'aw') | |
f = codecs.open("in.txt","r",encoding='utf-8') | |
rows1=[] | |
for row in f: | |
row = row.strip() | |
rows = re.split('\t',row) | |
rows1.append(rows) | |
print rows1 | |
w = csv.writer(fp,delimiter=',') | |
for r in rows1: | |
r = [s.encode('utf-8') for s in r] | |
w.writerow(r) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment