Welcoming
(Welcoming)
January 21, 2021, 12:00pm
1
Hello,
I have two string variables with informacion delimited by the symbol /
Variable1: Hello/my/name/is/Peter
Variable 2: Bye/your/surname/is/Jackson
There can be any undetermined number of / for each variable (it may be 4 as in the example but also 5, 7, 92, 101…)
I need to insert those information in a Data Table so that Variable1 is in the first column and Variable2 in the second column:
DT:
Column A Column B
Row0 Hello Bye
Row1 my your
Row2 name surname
Row3 is is
Row4 Peter Jackson
Please, could you help me?
kantheshm
(Kanthesh Mallesh)
January 21, 2021, 12:07pm
2
Hi @Welcoming ,
You can use assign activity and assign the value as
datatable.Rows(row_index)(“ColumnName”)= Variable 1
datatable.Rows(row_index)(“ColumnName or Column Index”)= Variable 2
Welcoming
(Welcoming)
January 21, 2021, 12:10pm
3
Thank you. The issue is that every row contained in each column is separated by ‘/’ in the variables… So I would need first to get the information in the variables… wouldn’t I?
ppr
(Peter)
January 21, 2021, 12:18pm
4
Split the strings a below and return a list
bring all lists (for your different strings) to an equal length
retrive the length of the longest list
fill up all other lists with blanks
prepeare your empty datatable (build datatable) manually / dynamic addition of the data columns
add the datarows by accessing the list with looped index like myList1(0) for retriving the value for the first row
kantheshm
(Kanthesh Mallesh)
January 21, 2021, 12:19pm
5
@Welcoming
In this case use,
Assign activity
Var[array string datatype] = String.split("/"c)
Use AddDataRow activity to add data to datatable.
In Property panel of adddatrow, in ArrayRow pass tat variable & in DataTable pass DataTable_Variable
1 Like
system
(system)
Closed
January 25, 2021, 10:15am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.