Extract data with slipt from a txt file

Hi community

I have a txt file that has the following data:
Índices da combinação encontrada: [1, 2, 3]
Valores da combinação encontrada: [1022.61, 1022.61, 1022.61]

I just need you to come back to me: [1, 2, 3] and [1022.61, 1022.61, 1022.61]

This information is variable

@amanda.gondim

you can use below regex \[.*\]

requiredstring = String.Join(",",System.Text.RegularExpressions.Regex.Matches(stringvariable,"\[.*\]",RegexOptions.MultiLine).Cast(Of Match).Select(function(x) x.value))

cheers

Hi @amanda.gondim

Please check the below attached files:

Regex Syntax: "\[[ ,\d+.]+\]"

Xaml:
Sequence5.xaml (7.6 KB)

I need to access numbers 1,2,3 , I need to scroll through each number.
for example, for each number inside “” return the corresponding index, how can I do this?

I need to access numbers 1,2,3 , I need to scroll through each number.
for example, for each number inside “” return the corresponding index, how can I do this?

hey @amanda.gondim
After extracting the value from regex
split the string by " , " and it will array of string [1, 2, 3]
use the loop now can you perform further .

cheers :upside_down_face:

I need them to be separate arrays.
[1,2,3] be an array and [1022.61, 1022.61, 1022.61] other and then go through each one

1 Like

hey @amanda.gondim

string_variable = “1,2,3 "
array_string = string_variable.split(”,")

now use arry_String variable in For each

cheers :upside_down_face:

Hi @amanda.gondim

Below workflow should help you:

Regex Syntax: "\[[ ,\d+.]+\]"

Assign syntax inside For Each:
Array = currentItem.ToString.Replace("[","").Replace("]","").Split(","c).Select(Function(x) Cdbl(x)).ToArray

Array is of DataType Array(System.Double)

Xaml:
Sequence5.xaml (11.7 KB)

Regards


Could you help me with this error?

@amanda.gondim

Use full name space as below

requiredstring = String.Join(",",System.Text.RegularExpressions.Regex.Matches(stringvariable,"\[.*\]", System.Text.RegularExpressions.RegexOptions.MultiLine).Cast(Of System.Text.RegularExpressions.Regex.Match).Select(function(x) x.value))

Cheers