Comparing file names


#1

Hello,

I have a folder of 1000 files and some of them belong to each other, which means that their name starts similarly such as:
20170821.pdf; 20170821_02.pdf, 20170821_03.pdf, 20170820.pdf, 20170820_02.pdf etc.

I am able to get the name of the latest file with File = new DirectoryInfo(myPath).GetFileSystemInfos().OrderByDescending(function(fi) fi.CreationTime).First()

but I need to do a comparison with the next file if it has the same name in the beginning. Can you please help me?


#2

Hey @mario

Please check out below thread. I think it will fulfill your needs.

Regards…!!
AKsh


#3

Hi Aksh1

Is there a way we can find if there are files with same name but different types in a folder ?

for example …
test.pdf
test.doc
text.xlsx

Avi


#4

Yes, there is and in fach it is very easy.

I share you and example Search_Files.xaml (12.0 KB)

My path contains all these files, and as you will see the result in the message box is 2 because in the arrays the items start in 0 (It is said, there are 3 elements that contains the name “Archivo” without taking into account the extension ).

image

I hope this example help you to solve your task