How to extract or get the specific text from a sentence or excel sheet?

Hi All, so far you guys have been awesome solving all my questions so thank you so much for the awesome help.

Now to the question, I get a Excel report every morning with case numbers, these case numbers look like this: Incident: INC1234567, I need to extract only the INC1234567 and be able to write it into a web form, now i know how to write it into a web form, but i don’t know how to get only the INC12134567 without the “Incident:” prepended.

Please take a look at the Example report, from the column C I only need the following case numbers: “INC1234567” not “Incident: INC1234567”

How can I do this? Thank you in advance

hi @Sidney_Vogel


just use a for each row to loop into the C column, and for row do the split, and thats all mate


1 Like

I agree with this, but I would suggest the space character instead as that will otherwise return " INC1234567" instead of “INC1234567” as they wished.

1 Like

Hi Thank you for your solution, that works how ever i also get Item: not just the INC, for better understanding take a look at this example report pleae. Example Report.xlsx (9.8 KB)

just trim the expression and the spaces dissapear like that:
result = var.Split(":"c)(1).Trim

so i think you need all the text that is after the colon?

Yes that is correct, everything after Incident: which is INC1234567

1 Like

continue use the expression i gave to you, the split method take the text after the colons, doesn’t matter what exist before or after, the method just divide the expression while he find any “:”
Sequence.xaml (8.5 KB)

it works for me, let me know any issue, Regards!

When i use this expression: row.ToString.Split(":"c)(1) i get an error message stating: Write Line: Index was outside the bounds of the array.

Thank you @fernando_zuluaga you sugestión worked perfectly.

did you solved you problem? if yes, mark as solution to close the topic.


Thank you. Marked as solved

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