How Get all filename one by one without extension

can help me to create sample create folder name with Get all filename one by one without extension…
im very beginner to that

1 Like
fileList = Directory.GetFiles(folderPath)

ForEach fileName in fileList
   filePathWithoutExtn = Path.GetFileNameWithoutExtension(fileName)

Regards,
Karthik Byggari

2 Likes

Hi @den_bagus

I’m not sure about your requirement.
If you want to create folders by looping a list of files then use the attached workflow.
samplefolder.xaml (4.8 KB)

1 Like

did we try with CREATE DIRECTORY activity
that is if we have the list of filenames with extension either, pass that array or list variable ot a FOR EACH Loop as a input and change the type argument as string in the property panel of FOR EACH activity
–inside the loop use CREATE DIRECTORY activity where pass the input as
"yourfolderpath\"+"Path.GetFilenamewithoutextension(item.ToString)
so that it will create that folder under the mentioned folder path

kindly try this and let know for any queries or clarification
Cheers @den_bagus

1 Like

@den_bagus,

You can try the following options

File Name with extension into a List of string

New System.IO.DirectoryInfo(strDesktop).GetFiles().Select(Function(file) file.Name).ToList()

File Name with extension into a String Array

New System.IO.DirectoryInfo(strDesktop).GetFiles().Select(Function(file) file.Name).ToArray()

File Name alone into a List of string

New System.IO.DirectoryInfo(strDesktop).GetFiles().Select(Function(file) Path.GetFileNameWithoutExtension(file.Name)).ToList()

File Name alone into a String Array

New System.IO.DirectoryInfo(strDesktop).GetFiles().Select(Function(file) Path.GetFileNameWithoutExtension(file.Name)).ToArray()

Full path into a List of string

new System.IO.DirectoryInfo(strDesktop).GetFiles().Select(Function(file) file.FullName).ToList()

Full path into a String Array

new System.IO.DirectoryInfo(strDesktop).GetFiles().Select(Function(file) file.FullName).ToArray() 
4 Likes

thx evryone to solve my problem.:blush:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.