Click here to Skip to main content
15,905,232 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I had some files in a folder and some files in another folder I have to compare each file in one folder with each file in another folder and then replace some text with some text in another folder if the name matches.

For Example I had a folder with names dw_add_item, dw_item_list, dw_item_container_list, dw_container_list, etc.. and in another folder I had files like itemcontainermaster, itemlistcontainer, hierlistcontainer, itemcontainerlist etc.. Now I want replace text of itemcontainermaster file with the text in file dw_item_container_list only Here I was using split and storing the strings in an array inorder to get the names of files of first folder and then comparing each name with the another file of second folder.

Can anybody please help me out.

Richard MacCutchan 29-May-14 4:04am    
Help with what, you have not explained what the problem is?
Member 10042156 29-May-14 4:33am    
Please go through the example in the above I was not getting how to match the names of the files.
Richard MacCutchan 29-May-14 4:38am    
See MSDN contains the answers to simple issues like comparing 2 strings.
Richard MacCutchan 29-May-14 5:43am    
I don't quite understand what the criteria for matching the filenames is. You state in your question "Now I want replace text of itemcontainermaster file with the text in file dw_item_container_list", so how are you matching these filenames?
Member 10042156 29-May-14 6:11am    
I am having xsd files in one folder which contains queries in it and another file has controllers in it. I want to place the respective query into respective controller by matching file names. and how I am matching the filenames is what I said above. Is there any other way to match those file names? Can you tell me any other way to do this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900