Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
I have a table whose entry like below:
idname

asp0362
klip632
hlpp632
gtr852a


And i have folder which having file with name as shown below:

asp0362_20150101.txt
hlpp632_20150101.txt
cfgo0602_20150101.txt


Now i want to compare filenames before date like(aapo6321) and idname from table and want to get the name of files which are not in table of DB.
Posted
Updated 20-Jan-15 14:01pm
v3
Comments
[no name] 20-Jan-15 14:39pm    
Have a look to http://msdn.microsoft.com/en-us/library/system.io.directory(v=vs.110).aspx[^], maybe it will give you an idea.
ZurdoDev 20-Jan-15 14:45pm    
Where are you stuck?

1 solution

Suggestion: write it in pseudo code and then translate into C#.
E.g.
for each file name in directory do loop
   prefix = file name up to and excluding first "_"
   write prefix if prefix is not contained in Table
end loop
Translating into C# is left as exercise.
Cheers
Andi
 
Share this answer
 
v2
Comments
Member 11385919 21-Jan-15 10:02am    
I am new to C# technology.
Can someone provide me complete solution of above question.
Andreas Gieriet 21-Jan-15 10:10am    
Homework assignment?
Andi

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