program to split file data and sort using dictionaries