I am new to this tool. Actually my requirement here, In my directory list of text files are available, so I want to consolidate all files together. I don’t know which activity I need to use inside the loop “For Each”. I have used read text file activity, but its through an error “Read Text File: One or more errors occurred”.
Hi
Welcome to uipath community
Hope these steps would help you resolve this
Use a assign activity like this arr_files = Directory.GetFiles(“yourfolderpath”,”*.txt”)
Where arr_files is a variable of type array of string
—now use a for each activity and pass the above variable as input and change the type argument as string in the property panel
—inside the loop use a READ TEXT FILE ACTIVITY And pass the input as item.ToString
And get the output with a variable of type string named str_input
—now use a assign activity like this str_output = str_output + Environment.Newline + str_input
Where str_output is a variable of type string with default value as string.Empty defined in the variable panel
—followed by this For each loop use a WRITE TEXT FILE activity and mention the input as str_output and the file path of the text file