<s> """<STR_LIT:U+0020>""" <EOL> import os <EOL> import string <EOL> def table_start ( data ) : <EOL> offset = data . find ( '<STR_LIT>' ) <EOL> offset = data . find ( '<STR_LIT>' , offset + <NUM_LIT:1> ) <EOL> return offset <EOL> def convert ( file_in , file_out ) : <EOL> if not os . path . isfile ( file_in ) : <EOL> print '<STR_LIT>' + file_in <EOL> exit ( <NUM_LIT:1> ) <EOL> with open ( file_in , '<STR_LIT:r>' ) as wiki_file : <EOL> wikisrc = wiki_file . read ( ) <EOL> start = table_start ( wikisrc ) <EOL> end = wikisrc . find ( '<STR_LIT>' , start ) <EOL> data = wikisrc [ start : end ] <EOL> print ( '<STR_LIT>' + file_out ) ; <EOL> with open ( file_out , '<STR_LIT:w>' ) as f : <EOL> rows = data . split ( '<STR_LIT>' ) <EOL> for row in rows : <EOL> lines = row . split ( '<STR_LIT:|>' ) <EOL> lines . pop ( <NUM_LIT:0> ) <EOL> for line in lines : <EOL> f . write ( line . strip ( ) + '<STR_LIT:\t>' ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> print '<STR_LIT>' + str ( len ( rows ) ) + '<STR_LIT>' <EOL> convert ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> convert ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> convert ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> convert ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> convert ( '<STR_LIT>' , '<STR_LIT>' ) </s>
