The following is an example of how you can use an ASL script to parse out fields using delimiters (see Note statement):
Field to be parsed
In the following example, the ipmac field with the value "10.200.5.20,MAC" needs to be parsed up to the delimiting "," character.
START { ..eol
}
do {
ipmac="10.200.5.20,MAC";
ip = PARSEIP(ipmac);
print("ip=".ip);
}
ASL parsing code
The following PARSEIP(ipmac_input) block of ASL code has the delimiter which does the parsing of the field to be parsed. The PARSEIP(ipmac_input) block of code must be added to the top of the main script as a rule, then called from within the loop.
PARSEIP(ipmac_input) {
input = ipmac_input;
delim = ",";
w : word .. eol
}
do {
return w;
}