change os.system to pipe
delete file after processing