Today is literally my 2nd day using UIPath so please be patient and let me know how to correctly use the forum as needed.
I found an existing forum topic and the XAML example in the existing topic has an error and I’m getting the same error (Combine Text (.txt) files in UiPath)
I have a folder with 1,500 TXT files that I need to append together. I’ve already had success using the “Append To CSV” activity and basically I want to do the exact same thing except for 1,500 TXT files. I’m not finding an “Append To TXT” activity in UIPath so I think I need to use an “Assign” activity.
My XAML so far
- create an arrayOfFileNames for all 1,500 TXT files (success)
- process for each item in arrayOfFileNames and use “Write Line” activity to display each file name in Output so that I know I have that loop working (success)
- then for each file I use “Read Text File” activity to assign contents of TXT file to a variable of type Sting and that var is called fileContentsFromSource
- I created a var of type String (array of Strings) called targetTextArray
- finally I do an “Assign” activity as follows targetTextArray = targetTextArray + fileContentsFromSource
- reminder: targetTextArray is String and fileContentsFromSource is String
- I get the following message: Compiler error(s) encountered processing expression "targetTextArray + fileContentsFromSource / Operator ‘+’ is not defined for types ‘1-dimensional array of String’ and ‘String’
- So how do I combine together 1,500 TXT files?
Thanks!
Paul Ehrsam
My 2nd day using UIPath