Skip to content

Instantly share code, notes, and snippets.

Created August 14, 2014 17:45
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 anonymous/b0beb5dc24abc6669f8d to your computer and use it in GitHub Desktop.
Save anonymous/b0beb5dc24abc6669f8d to your computer and use it in GitHub Desktop.
#-*- coding:utf-8 -*-
import re
import random
import codecs
I=open('.\CET.Shuffle.txt','r')
O=open('.\CET.Rebuild.txt','w')
Lines=I.readlines();
for Line in Lines:
if Line[0]=='A':
Splited=Line.split(' ')
NewLine=Splited[0]+' '+Splited[2]+' '+Splited[1]
NewLine=NewLine.replace('\r','')
NewLine=NewLine.replace('\n','')
NewLine=NewLine+'\r\n'
O.write(NewLine)
else:
O.write(Line)
I.close()
O.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment