why would I make the typeArgument string if they are files and haven’t been converted to strings yet? Just trying to understand the logic behind that I am a bit confused thank you
@Thomas_Marzol - the TypeArgument should be string because you are telling UiPath what type of items are contained within the IEnumerable that you are iterating through.
I made the assumption that folderpath is an IEnumerable of strings. I assumed you were using Directory.GetFiles(“C:\YourFolderPath\GoesHere”) to get the list of files.
Since folderpath is an IEnumerable of strings (it’s a collection of file paths saved as strings), you need to tell UiPath that the variable you named file in your IEnumerable is of type string.
It’s important to remember that you aren’t iterating through actual files/applications. Instead, you are iterating through a list of strings pointing to the files
@Dave to help flush this out. I have attached a more elaborate file that has more of what I am trying to do.
What I am starting with is a folder of text files. These were generated via another OCR activity. That all is working great. What I need to do is for each file in the folder, read the text and see if the keyword “577” is present, if it is I do stuff, if it isn’t move onto the next file.
Another way of describing the problem is I need to start with a text file and end with a string I can read/parse/split/cut up, in an iterative fashion. I followed your advice and am running into a new error. I will follow up with specifics.questionrevised.xaml (5.8 KB)
This includes annotations in here on what things are doing. Basically first you have a folderpath. This is a string and it is the folder/directory containing all of the files. Next, you want to get a list of all of the files in the folderpath. Then you want to iterate through each file within the folderpath, read the text file and check if it contains a specific keyword. If it contains the keyword, do stuff. If keyword is not found, leave it blank (do nothing) and move onto the next file in the folderpath.
I can help point out specific issues too, but please ask if you have any clarification questions on how something works or why I chose to do it. I tried to annotate to help with this, but it’s easier to ask questions