How i can read excel columns can get the duplicates values warning in excel or txt file

Hello Dev can anyone help me with below scenario.

Read the excel columns and if there is duplicate column than it should record the warning message and print it on excel or .txt.