Convert system.FileInfo datatype into 1-D string array

Hi All,

Can anyone tell how to convert system.FileInfo datatype into 1-D string array datatype.

Thanks in advance.

what is the error in the validation?


If you want to convert fileinfo string() to string() then try like this,

 Directory.GetFiles("DirPath", "*.*", SearchOption.AllDirectories)

May I know the purpose of converting the fileinfo to string array.


Hi @sarathi125 ,

I want to sort files inside the folder and storing in array.

You have to store them like Path(0),path(1)
so that you can use counter starting by A=0
so you should assign
then assign A=A+1
make sure that length of array of Path and looping is same else you will get error of index out of boundry
for making sure of that u ca use condition for A value validation
like A>loopingarray.length

Here “Path” is your string array, so have the index value in the left side of the assign activity and pass the value from the right side.

EX: Path(0)

Regarding the sorting, on which criteria you want to sort the files, we can do it using linq directly with will result as List(Of String) datatype.

Hi @ImPratham45,

I will try and incase of anything I will let you know.

Thanks you.

Your Most Welcome !!!

Happy Automation.

@sarathi125 Thank you:+1:

I will try to in both the ways.

Incase of any issues I will let you know.