I have a scenarios where there will be multiple lines of data in Notepad.
My Flow goes line by line and validate that particular line item data.If my conditions fails in that particular line(row).I have to update the data with string manipulation and go to next line.How can i have this automated at runtime.
Hi @JITU99 ,
Have you tried using the feature to get the text in your notepad file as a String and paste it into Excel or CSV, use it as a data table and then process each row?
Regards,
You can read the data from text and then convert it into datatable using generate datatble and then you can convert back to string using output datatable and write back to text file…if in datatable its easy to edit inidividual rows in loop
The same can be acheived using loop through lines as well…but instead from text file directly reqd into string and concert it to an array of lines by splitting it on new line then iterate through do the modifications and then join back using newline again and write to text file
Read Text File ‘yourfile.txt’ → Output to strNotepadContent
Assign arrLines = strNotepadContent.Split(Environment.NewLine.ToArray(), StringSplitOptions.RemoveEmptyEntries)
For Each item in arrLines
If NOT ‘condition’ Then
‘Perform string manipulation’
Assign arrLines(index) = ‘manipulated string’
End If
Next
Assign strUpdatedContent = String.Join(Environment.NewLine, arrLines)
Write Text File ‘yourfile.txt’ or ‘newfile.txt’ → Input from strUpdatedContent