It would be most helpful if you could provide: (a)a few example lines and (b) expected output for those lines. Also when you run code and say "it doesn't work", that is very nonspecific. You don't provide any data to run your code against. I have no idea of what you are trying to accomplish.