return text.replace('US', 'U.S.')
  
  return text 

def replaceUK(text):
  if 'UK' in text:
    return text.replace('UK', 'U.K.')

  return text

if __name__ == "__main__":
  print("Parser of Excel XMLs by @vpascual\n")

  if len(sys.argv) < 3:
    sys.exit("Not enough params. Usage: python xml2json [source_folder] [output_file_name]")

  source_folder = sys.argv[1]
  filename = sys.argv[2]
  # list_of_files = pyUtils.getListOfFilesFromPath('data/global-mba-rankings/', '', '.xml')  
  list_of_files = pyUtils.getListOfFilesFromPath(source_folder, '', '.xml')  

  if len(list_of_files) <=0:
    sys.exit("ERROR: Can't find xml files")

  output_file = open(filename, 'wb')
  # writer = csv.writer(output_file, delimiter=';', quotechar='"', quoting=csv.QUOTE_NONNUMERIC)
  for f in list_of_files:
    parseFile(f)

  output_file.write(json.dumps(buildFinalObj()))
              csv_row.append(-100)
            else:
              csv_row.append('')

          else:
            if dataType.lower() == 'number':
              csv_row.append(column.data.contents[0].replace(',', '.'))
            else:
              content = column.data.contents[0]
              csv_row.append(pyUtils.returnNormalText(content))                

        writer.writerow(csv_row)

    # print("Row: " + str(i+1) + " " + '.'.join(csv_row))
    i = i + 1
  
  # file.close()    


if __name__ == "__main__":
  print("Parser of Excel XMLs by @vpascual\n")
  list_of_files = pyUtils.getListOfFilesFromPath('data/global-mba-rankings/', '', '.xml')  
    
  # output_file.close()
  for f in list_of_files:
    output_file = open(pyUtils.getFileNameWithoutExtension(f) + '.csv', 'wb')
    writer = csv.writer(output_file, delimiter=';', quotechar='"', quoting=csv.QUOTE_NONNUMERIC)
    parseFile(writer, f)