hacky
(NotHacker)
October 21, 2022, 9:13am
1
Hi team,
Experts:- @supermanPunch , @ppr Plz help
I am having as data as shown below:
I am able to get it into the Datatable and trying to use the string manipulation on the cell (cell has all the data from “0 - Pickup … Main data”) AND WHAT I want is to fetch text “Main data” into a string variable.
But issue is that onces I am printing value in the message box, I am getting the string in following manner:
I tried splitting string with respect to " ", “\n” , “\t” etc
But the bot is assuming a string to be as shown below:
which is making it impossible to extract the Main data into the string variable.
[Note: number of words in all the lines are dynamic]
Kindly suggest,.
Thanks and regards,
@hacky
ppr
(Peter Preuss)
October 21, 2022, 9:19am
2
Give a try with a regex split
arrSplit | String Array =
System.Text.RegularExpressions.Regex.Split(YourStringVar,“\r?\n?”)
Hello @hacky
Can you please share a sample excel with the input data? This will help to apply the required expression.
Thanks
hacky
(NotHacker)
October 21, 2022, 9:21am
4
@Rahul_Unnikrishnan
Apologies, the data is confidential, cannot share it online. I tried to make a dummy data to mimic the real time data in this case.
@hacky
Plz refer to the below similar post as well.
i want to get the last two words in a sentence for example “this is a test result.” and i want to get in the output is “test result”. how can i achieve this? i’ve been trying for days but i can’t seem to find any solution as the sentence changes it’s length dynamically. is there any way to achieve this goal? i’m a newbie so i still don’t know a lot.
Thanks
@hacky ,
Alternate Check on the below Expression :
System.Text.RegularExpressions.Regex.Split(YourStringVar,"\s{2,}")
ppr
(Peter Preuss)
October 21, 2022, 9:27am
8
hacky:
Not working.
better to tell us the details.
Lets do one thing:
Set Breakpoint
debug and get paused
use the immediate panel and type in the variable with the cell tect value string OR the retrieval to the particular cell value
Just share it with us. Thanks
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
hacky
(NotHacker)
October 21, 2022, 9:30am
9
Unrecognized escape sequence
hacky
(NotHacker)
October 21, 2022, 9:32am
10
@ppr Actually I am not using UiPath, I am using another tool based on dotnet framework itself. And since logic remains same, I am asking it here.
@hacky ,
May we ask you which tool is being used ? Also How is the suggested Expression used in that tool ? Is there an intelli sense available in it ?
hacky
(NotHacker)
October 21, 2022, 9:40am
12
@supermanPunch
System.Text.RegularExpressions.Regex.Split(dt_RawDatatable_RouteInformation.Rows[1][“Column1”].ToString(), @“\s{3,}”).Count()
This works.
1 Like
system
(system)
Closed
October 24, 2022, 9:41am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.