Split two string delimited by a comma

I’m trying to split the two text delimited by a comma. My problem was when making an output of the arrText(1).ToString it include the text of the next row. How to remove that?

This is the sample text.

170766123,itemA66373216
188059977,itemA01502409
169498025,itemA48202024
147855226,itemA11666073

we can treat is like CSV Data and using comma as delimiter char

have a look at:

And

And Regex

Hi,

In this case, it may be better to split by linebreak in advance, as the following.

Sample
Sample20240216-1.zip (2.7 KB)

Or try parse it as CSV using ReadCSV or GenerateDataTable etc as @ppr mentioned

Regards,

This is CSV text. Use the Generate Data Table activity.

Hi @craigmartin
We have to first split the sample text with the line break… that will be stored in string arrays str_arr as str_arr[0],str_arr[1], str_arr[2], str_arr[3]
Then you have split each of these again with a comma seperator.
For eg ( (str_arr[0].Tostring).split(“,”)). Tostring will give you now only that specific row value.

Hope this finds you helpful

Hey @craigmartin
check below solution:
allText.Split(New String() {vbCrLf, vbCr, vbLf}, StringSplitOptions.RemoveEmptyEntries)

BlankProcess105 (2).zip (10.3 KB)