I have below code which is working but taking time (around 10 min) and sometimes it is going in to not responding mode as my data has around 60k lines.
What i am tryi