Split a string in different variables


#1

Hello,

I need to separate a string in 6 different values and save them in different cells in Excel
I extracted a string from a .txt file using regex expressions.
The string I extracted is this one:
0 0 0 0 00 00
Now I need to store this 6 different values in 6 different variables, so I used:
String.Join(" ",myvariable.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries))
and saved the result in an array.
Then I extracted the 6 values but the result is negative.
It saves only the first, third and fifth (only 0 not 00).


Can anyone kindly help me in saving the variables?
Thank you so much.
Camilla.


#2

see attached file, it may helpreadTxtFile.xaml (7.2 KB)


#3

Thank you so much @Reshmamore, but when I try to open the xaml I find this error


Which activity is it referring to?
Thank you so much.
Camilla.


#4

update packages in uipath,
basically install all.


I am using split string activity there, with separator as environment.newline
And, StringSplitOptions as RemoveEmptyEntries


#5

Please uninstall “UiPath.Core.Activities” and again install it and restart uipath studio.
Check error once whether it has come or not again. let us know :slight_smile:
could you please tell us uipath version that you’ve been using?

Regards,
Pankaj


#6

Thank you @Pankaj.Patil I reinstalled the packages and now it works.
The version of the licence I’m using is 2016.2.6379 :slight_smile:


#7

Thank you so much @Reshmamore. It worked well :slight_smile:


#8

Well done!!,
Good to hear :slight_smile: