Closed GoogleCodeExporter closed 8 years ago
You could define it as a string with a pattern:
pattern: \((\d )+\d\)
You would have to parse the string on your end..(using awk?)
Original comment by corent...@gmail.com
on 16 Oct 2013 at 8:39
Would you please explain it with a small example. How can i write it in xml
file and use it in "test" and "ACTION".
Original comment by panwar.rahul@gmail.com
on 17 Oct 2013 at 4:58
In your XML:
<PTYPE name="DIGIT_ARRAY"
pattern="\((\d )+\d\)"
help="Array of digits"/>
Then for param in your command:
<PARAM name="my_param"
help="my param Array of digits"
ptype="DIGIT_ARRAY"/>
I don't understand what you mean by use it in test.. Can you clarify that point?
In action:
<ACTION shebang="usr/env/python">
var = ${my_param}
var = var[1:-1] #remove first and last parenthesis
var_array = var.split()
print(var_array)
</ACTION>
Please note that I haven't tested this code (I don't have Klish environment set
up here!) I also used python as language since it is obvious how to do it in
that language. There are solutions for bash as well (example:
http://stackoverflow.com/questions/918886/how-do-i-split-a-string-on-a-delimiter
-in-bash)
Original comment by corent...@gmail.com
on 19 Oct 2013 at 12:46
Original comment by serj.kalichev@gmail.com
on 6 Feb 2014 at 10:17
Original issue reported on code.google.com by
panwar.rahul@gmail.com
on 16 Oct 2013 at 10:10