Jump to content
Sign in to follow this  
botanic

String split?

Recommended Posts

how can I go about setting the bold text below into a set of variables from a txt file?

2: 1: 0 |(Off) Note | chan= 1 | pitch=e 4

|On Note | chan= 1 | pitch=D 4 | vol=110

Edited by botanic

Share this post


Link to post
Share on other sites

$line = "2: 1: 0 |(Off) Note | chan= 1 | pitch=e 4"
$line = StringSplit($line,"|")

$a = $line[1]
$b = $line[2]
$c = GetValue($line[3])
$d = GetValue($line[4])

Func GetValue($text)
    $text = StringSplit($text,"=")
    Return $text[2]
EndFunc

Edited by Zedna

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...