I have a folder that contains many sub folders. First I want to check if there is any ".txt" file. If yes I will do nothing regardless of any other file formats that exist in the same folder. If there is not, I will check whether there is ".csv", If yes I want to convert it/them to ".txt". Same also applies here, if I find ".csv", I don't care about other file formats
If there is no ".txt" nor ".csv", probably it is ".doc". So, I want to convert it\them into ".txt"
So the logic is: Find ".txt", if you find; continue and don't do anything with that folder. If you don't find ".txt", look for ".csv", if you find ".csv", convert it\them to ".txt". Otherwise, look for ".doc" and do the same.
How I could do that ?