I cannot comment but @Ramesh Maharjan is there a limit of size of file for your approach?After testing I can find that file beyond 210Mb are giving out of memory error.Also,is there a better approach for same as this approach is working but will lead to performance issues for bigger data.Thanks