Where did the records come from? Can you open and view it notepad?
Of course you can analyze the file in a powerscript and make the changes. I am not prepared to auther this script for you, as it is inevitable that it will not work as you wish for it to, or it won't do a certain detail that you failed to mention, and I will have to keep working on it. For this reason, we do not provide turn key solutions.
If you wish to post some code and get help from that, I encourage you to go that route!