Copy all file names without file extension, paste it to excel

hi,
i have some files in my local folder(jpg,jpeg,rar,etc). Now i would like to copy all the files name without extension and paste it to excel. I have done something but i am getting the full name. I want only the file name not the extension.

filename.xaml (9.0 KB)

@ArafatRakib1

You can change the “Add data row” Input from “{new System.IO.FileInfo(file).Name}” to “{Path.GetFileNameWithoutExtension(file)}” to get file name without extension

1 Like

thank you, it’s working

A little bit more help please, there are some files with same names, i would like to entry only one name file into excel. Like there are 1.jpg and 1.rar file but i want only 1 in my excel. @Sasi.lalo

@ArafatRakib1

You can add a if condition to check and if not found then add like below:

dtFiles.AsEnumerable().Any(Function(x) x(“FileName”).ToString = Path.GetFileNameWithoutExtension(file))

in the else condition move your add row

It will work :slight_smile:

2 Likes