I have an excel with different types of produce like apples, grapes etc.
I have to create a csv file if the produce equal to Apples and create a file with that name.
I am able to create the files. But inside the file it is writing as follows:


So I have to have only the records of Apples-MISC if the file is Apples-MISC, if the file is Citrus-Orange I should only have Citrus-Orange inside but not other records. How can I achieve this. Appreciate all the help.
Thanks