Hello Team, I am having a text file which has data and data is not fixed but the structure is fixed.
I need data from there with the validation below is the screenshot of file for reference also I have attached the file ATTACH2.txt (1.7 KB) Doc1.docx (32.0 KB)
Please let me know if you have any solution for this
Take two variables one for String array ->named Split
Second one string variable → named Aftersplit
Textoutput->textop
To get the first row set values
Assign → Split = textop.Split({“AGENT”},Stringsplitoptions.None)
Assign → Aftersplit = Split(1).ToString
Assign → Split = Aftersplit.Split({Environment.Newline},Stringsplitoptions.None)
Assign → Aftersplit = Either Split(0).ToString or Split(1).ToString depending upon the line spacing
Assign → Split = Aftersplit.Split({" "},Stringsplitoptions.None)
Take an integer variable to store string length, let it be “Length”
Length = Split.length
output values for the first set of rows would be
Assign → Split = textop.Split({“AGENT”},Stringsplitoptions.None)
Assign → Aftersplit = Split(1).ToString
Assign → Split = Aftersplit.Split({“AGENT”},Stringsplitoptions.None)
Assign → Aftersplit = Split(1).ToString
Assign → Split = Aftersplit.Split({Environment.Newline},Stringsplitoptions.None)
Assign → Aftersplit = Either Split(0).ToString or Split(1).ToString depending upon the line spacing
Assign → Split = Aftersplit.Split({" "},Stringsplitoptions.None)
Take an integer variable to store string length, let it be “Length”
Length = Split.length
output values for the Last set of rows would be
Hello Pratik I just need 37931439 0000 W0 and 151334 from this file in your second screenshot W0 is missing could you please share me xaml so I can use
Hello Pratik I need 37459194 0100 W0 and151334 from first screen shot in some cases we don’t have W0 so we need to handle that as well please do let me know if you found some solution for the same
Thank you for the providing a Sample.
Thank you for providing the Output (W0)
Tell us about the Pattern of The text.
Does it always start with “W0”
What is the length of the result you need?
What are the combination of letters in the result?
Is it always present in the text?
The more information you provide the better Pattern and robust solution forum gurus can provide like @Pratik_Wavhal.
As @J0ska linked, take a look at the MegaPost and you will be in a much better place asking for help.
Hello Pratik I think we both have different version of uipath due to that one activity could not load in my uipath so could you please provide me screen shot of the same
Thanks
Hello Pratik I need whole line which I have sent you In your code only first and last but it should be all line which has polis and agent number
Can you give the exact output here ??
And one more question that will the number of lines of data will be dynamic or constant ??
For eg “REGIO=LEUVEN” have 3 lines of data that we have to extract & “REGIO=CENTR.REGIO” have 1 line of data that we have to extract
As @Steven_McKeering said just always clear the things in detail so that providing solution gets easier for all of us and so we also wont ask more ques again and again
Also @Steven_McKeering and all of us are der to give you much better solution always