#!/usr/bin/python
#-*- coding: utf-8 -*-

import sys
import os

def main():

	try:
		lstFile = sys.argv[1]
	except:
		return
		
	dot = lstFile.find( '.' )
	path = lstFile[0:dot]
	
	scratchFile=path + '.copy'
	command = "copy {0} {1}".format( lstFile, scratchFile )
	os.system( command )
	
	input = open( scratchFile, 'rt' )

	input = open( scratchFile, 'rt', encoding='utf-8' )	
	output = open( lstFile, mode='wt', encoding='utf-8' )

	for line in input:
		sline = 	line.strip()
		if sline.upper() == '#RELATON':
			output.write( '#Relation\n' )
		else:
			output.write( line )
			
	input.close()
	output.close()
	
	command = "del {0}".format( scratchFile )
	os.system( command )

	
main()
