Parsing Key Value Pairs From Shell Command Results

I recently saw a post asking how in Xojo to parse a data dump that was returned from a shell.result into key value pairs.

dim Rows() as string
//remove any extra line feed chars
//remove any qoutes
//break each row by chr(13) Carriage Return 
//CHR(13) might need to be updated depending on the target OS
for each s as string in rows
dim key as string
dim value as string

The code above will break the returned result into rows then break each row into a KEY and VALUE variable from which you can do what ever the applicaiton needs.

Leave a Reply

Your email address will not be published. Required fields are marked *