string 2 list

S

sg

Guest
Hello Guys,

I have a string value which is indeed a list of lists, is there any
way to convert it to list.

e.g.,

value = "((\"a\" (1 2 4)) (\"b\" (3 6 7)))"

what is best way to process this string as list as:

value = '(("a" (1 2 4)) ("b" (3 6 7)))

such I can use all list operation like assoc, car etc on this value?
 
On Jul 10, 6:04 pm, sg <samirgro...@yahoo.com> wrote:
Hello Guys,

I have a string value which is indeed a list of lists, is there any
way to convert it to list.

e.g.,

value = "((\"a\" (1 2 4)) (\"b\" (3 6 7)))"

what is best way to process this string as list as:

value = '(("a" (1 2 4)) ("b" (3 6 7)))

such I can use all list operation like assoc, car etc on this value?
hmmm...., I saw one of earlier q/a, linereadstring is the routine to
do so. Thanks, ::)
 
On Jul 10, 6:13 am, sg <samirgro...@yahoo.com> wrote:
On Jul 10, 6:04 pm, sg <samirgro...@yahoo.com> wrote:

Hello Guys,

I have a string value which is indeed a list of lists, is there any
way to convert it to list.

e.g.,

value = "((\"a\" (1 2 4)) (\"b\" (3 6 7)))"

what is best way to process this string as list as:

value = '(("a" (1 2 4)) ("b" (3 6 7)))

such I can use all list operation like assoc, car etc on this value?

hmmm...., I saw one of earlier q/a, linereadstring is the routine to
do so. Thanks, ::)
I don't know if this is the best way, but:

MyVal = "((\"a\" (1 2 4)) (\"b\" (3 6 7)))"
MyList = evalstring(strcat("'" MyVal))

works for this particular example.

-Pete Z.
 

Welcome to EDABoard.com

Sponsor

Back
Top