Transform txt file into rat