Skip to main content
October 15, 2021
Question

CSV string

  • October 15, 2021
  • 10 replies
  • 0 views
I have a csv string which i am getting it from blueprism through integration. i need to perform some calculation based on this value, i need to iterate this string. but i am unable to iterate its taking as only one string, i want to iterate for each line in this string.

"ABC,ABC,2,06:00:00,18:00:00,0.5,3
XYZ,XYZ,3,06:00:00,18:00:00,0.5,3"
please any suggestions on this.

    10 replies

    October 15, 2021

    You can use split() function which splits text into a list of text elements, delimited by the text specified in the separator. In your case delimiter is ",". 

    https://docs.appian.com/suite/help/21.3/fnc_text_split.html

    split("ABC,ABC,2,06:00:00,18:00:00,0.5,3
    XYZ,XYZ,3,06:00:00,18:00:00,0.5,3", ",")

    This will return individual elements from your original string that are separated by comma. You can then use a!foreach() to iterate over each element.

    October 15, 2021

    i have many lines, in each line it is seperated by comma's

    stefanhelzle0001
    October 15, 2021

    First, use split to get the lines using "char(10)" as the delimiter. Then, in a foreach, use the comma delimiter to get the values for each line.

    May 20, 2026

    If you found this post to be enjoyable, please ensure that you subscribe to ensure that you do not miss any future posts Moto X3m.