the content of the second .txt file is:
{“Id”:“128-c7f5-4fb9-b1d7-891bced4”}:GO
{“Id”:“3f2d-203c-4501-8308-97b0”}:GO
{“Id”:“9c-5b4b-47d7-a963-a4983c17”}:GO
{“Id”:“fe70a472-65cb-4411-b958-440adc”}:GO
{“Id”:“c1c8e-f68f-439c-9db0-ce0ce3ea”}:GO
Once they are read, I want to check if the word/variable “Id” is present on every row in each .txt file. If yes, I want to return a Boolean True, otherwise return a False.
This is will be in different workflows so hopefully I get one solution for each ( I suppose they will be similar(
I have looked at similar issues in the past but did not help.
Read Text File: First, use Read Text File activities to read the data from both of your .txt files. Output each of them to a string variable. Let’s say textData1 and textData2.
Generate Data Tables: The action will return the entire text data from each .txt file. Now we want to separate this into lines/rows. We can do this by using Generate Data Table activity and outputting to datatable variables, say dataTable1 and dataTable2. Use NewLine as Column separators in the properties of the activity.
For Each Row: Use two For Each Row activities (one for dataTable1 and another for dataTable2). In each of these, use an If condition. In the condition field, use row(0).ToString.Contains("""Id""") and if the condition is false, Output a Boolean Variable as False and break the loop.
After the For Each Row activity, If no row is missing the “Id”, your Boolean will remain at its default value of True.
Note: row(0) is used because the first column will contain each line from your text file. Adjust if more columns are present in your scenario.
it seems you assume these files have something to do with each other.
These are two different workflows, I just lumped the questions into one.
Could you provide a solution/suggestion for just one?
Attached is my workflow. It should be returning a TRUE because “id” was found in the file, but its returning a false instead. I suspect this behavior is because I couldnt figure out how to Use NewLine as Column separators in the properties the generate Data Table of the activity.
Kindly help! Thanks