How to split string and convert it into data table

Hi All,

I have a string like: abc9:35 pmd1ef9:48 pmghi9:11 amijk11:28 am

By manipulating this string the output

image

Note:The length of digits can vary in first column and no:of rows can vary based on string

How can i convert it to data table as 2 column as shown above

Please help me to solve.

Thank you in advance

1 Like

To split the string you have above, you need criteria for splitting it properly. If there is no programmatic way to locate the end of column 1 and the beginning of column 2, converting to a datatable or a parsable string will be difficult.

However, if you have a way to split the string, let’s say you have an array of arrays [[abc, 9:35], [pmd1ef, 9:48], [pmghi, 9:11], [amijk, 11:28 am]], you can insert the data to a table.

First, use the Build Table activity to create a table with 2 columns. Next, create a for each loop over the array items. Insert an empty row {} using the Add Data row activity. Insert array item 0 to column 1 and item 1 to column 2 at the current row index. You can keep track of the row index by incrementing a variable for each iteration of the loop.

thank you,but it is the output of get text activity …i cannot manage it before itself

here you go
BlankProcess13.zip (10.4 KB)

Cheers @UR_UDAY_KIRAN

1 Like

Hi @Palaniyappan
Both the matches has same regex pattern.

Please let me know what this regex will do-
β€”> β€œ[0-9]\W[0-9]+\s(am|pm)”
β€”> β€œ[0-9]\W[0-9]+\s(am|pm)”

This will take the wording with respect to time
That is in the string we have 9:35 pm and 9:45 pm like that right
So first tried to get them with the above Regex
And splitter with same Regex so that we can get text apart from those time wordings

Cheers @shubham_sethi @UR_UDAY_KIRAN

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.