Read Files Folder

Anyone can help me to read files from file folder and each file will be display in the Output…?

The screenshot of mine files folder:

Regards,
Brian

@Brian_Henokh1

Do you read all files from these 3 folders right ?

If yes then try below expression.

  files [] = Directory.GetFiles("Parent FolderPath",searchOption.AllDirectories)

Then use ForEach loop to iterate all files.

ForEach item in files
 Print item
1 Like

yes, but before that i must to read 3 folders that and the output will be print in the output, like this:

‘In output’

157554280810
157554430745
157559807612

@Brian_Henokh1

If you want to read directory names then try below.

     getDirectories [] = Directory.GetDirectories("Parent FolderPath")
1 Like

That expression is using for read file each folders inside, right?

1 Like

Can you help me to solve that problem?

@Brian_Henokh1

File inside variable should be of type Array of string i.e. System.String[ ]

i have changed the variable type FIle Inside to be Array String but still got same error :sweat_smile:

@Brian_Henokh1

I guess now you will get some other error. Please show me screenshot of that error.

@Brian_Henokh1

Could you please send me the workflow. will check and update you.

This is the error screenshot. Can you help me?

@Brian_Henokh1

Zip the process folder and send me. Need to check once.

1 Like

@Brian_Henokh1

You sent empty file. I opened the xaml file and it does not have any activities.

Sequence.zip (1.3 KB)

That’s it… I’m sorry before :sweat_smile:

@Brian_Henokh1

Try this:

         FileInside [] = Directory.GetFiles("\data\"*.*",SearchOption.AllDirectories) 

If you want to read all files then mention “.” else specify like below for particular files.

Excel - “.xlsx"
PDF - "
.pdf”
etc…


i have tried that but still got error like a screenshot above.

i change the “\data” to FilesDirectory variable because i want read files in the each folder in path FilesDirectory. I’ve got the error look like a screenshot below.

Screenshot:

Please guide me…

@Brian_Henokh1

Please check below attached workflow.

Sequence.xaml (5.8 KB)

Here, replace FolderPath with exact folder.

1 Like

Overall is fine… Thank you so much for your help and guide to me

Regards,
Brian

1 Like

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