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


#1

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)


#2

@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


#3

thank you, it’s working


#4

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


#5

@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: