splitting text into a multidimensional array

  1. last week

    Dear Forum, I would like to ask your help on splitting a text into a multidimensional array. This is a sample text as it will look like:

    Dim t As Text
    t = "#01:00:03-4# Line 1
    #01:00:10-0# Line 2
    #01:00:12-2# Line3"

    I now would like to split the timecode between the hashtags into one column, the text after the time in each line to another column. The timecode should be formatted as timecode, so I can calculate it like that. Anybody ready to help? Thanks!

  2. Tim H

    Dec 3 Pre-Release Testers Portland, OR USA
    // assuming t as above and a listbox named listbox1
    dim lines() as string
    dim columns() as string
    
    lines = split(t, EndOfLine)
    for i as integer = 0 to ubound(lines)
       columns = split(lines(i), "#"
       listbox1.addrow(columns(1), columns(2))
    next

or Sign Up to reply!