" How do you avoid making duplicate entries while loading the data from text file? Because if I upload the same text file, it does and is populating database with duplicate entries! How to avoid that? "
For that, you need to have to have to have your database design proper with primary key constraint set.