How to ignore 2nd delimiter in a data table

Do you need to use generate table activity? Instead u could use build data table (dt_Final) with two columns, the split text by new line:

Arr_Strings = split(str_emailText, Environment.Newline)

After that In for each loop for that array:

str_Text1 = Trim(item.Substring(0,instr(item,“:”)))
str_Text2 = Trim(item.Remove(0,instr(item,“:”)))
Add Data Row {str_Text1,str_Text2} to dt_Final.

Then you will have dt with two columns and no matter how many colon would be in one line, the first colon would be always separator. Of course you can also try to add values directly to dictionary (without building dt) but that’s another pair of shoes :wink:

Can you copy the below text as it is from email and send

Firstname: Kavipriya
Secondname: Moorthy
Rep notes: Notes: 2021

copy pasting your text works. Is it because of the space

image

If I uncheck the csv parsing and keep : as the delimiter, it throws this error

@Yameso the input comes from an email with 25 values.

It would not work for this text because if you want to parse line with colon separator you have three columns (in your example from first post when you noticed the problem) if you will not use csv parse the you will get one column in your data table. So there is no column1 in it. To work with that you should first correct input string to change first colon in each line for another separator (for ex semicolon). But still you will need for each loop activity to do that. Maybe some regex pattern could do that also too.

Try with my for each loop solution as I wrote it above :wink:

I don’t understand. Your text has 25 lines and each line is value to fill data table so you want dt with 25 rows?

If your email give you text as shown above then you will be able to build that simple for each loop and this amounts of values is irrelevant :wink:

Instead of generating data table try to split your string using New Line and then loop through the array…

Then split each line item of array using : and then assign it to dictionary

1 Like