I scrape web page and ending up with a text that i process multiple times, my end result is something like this before then final result.
But using multiple assigns to do the split i see is not efficient…I guess
[Sample text]
Item1 Normal
Item2 Normal
Item3 Normal
The result of the above is saved into a variable (string), “strMyMultiLine”. To split this further into single lines i have used the following split-function within an Assign activity to store it into a new variable (string) called strItem1, strItem2, strItem3.
strMyMultiLine.Split(new String(){Environment.NewLine},StringSplitOptions.None)(0)
strMyMultiLine.Split(new String(){Environment.NewLine},StringSplitOptions.None)(1)
strMyMultiLine.Split(new String(){Environment.NewLine},StringSplitOptions.None)(2)
This works perfectly so i got all the lines separated into single variables:
Item1 Normal
Item2 Normal
Item3 Normal
But i need to split them further, as you can see i have two spaces between Item and Normal ( ).
So i use the same code again to only keep the last bit of information “Normal” or whatever value might be there. Again, this is also run in a new Assign activity and assigned into yet a new variable.
strMyFinalSplit_status.Split(new String() {" "},StringSplitOptions.None)(1)
Normal
I assume or guess there could be some kind of pipe function or something i could use? How can i consolidate these two assign into one assign?
Ok,ok,ok, before you shoot me, there is indeed more assigns in my workflow as there is multiple white spaces of different that i have taken care of so if its possible to consolidate these into one would be awesome.