EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

string 2 list

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Cadence - string 2 list

sg
Guest

Sun Jul 10, 2011 3:04 pm   



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?

sg
Guest

Sun Jul 10, 2011 3:13 pm   



On Jul 10, 6:04 pm, sg <samirgro...@yahoo.com> wrote:
Quote:
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, :Smile

Pete Z.
Guest

Tue Jul 19, 2011 1:32 am   



On Jul 10, 6:13 am, sg <samirgro...@yahoo.com> wrote:
Quote:
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, :Smile

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.

elektroda.net NewsGroups Forum Index - Cadence - string 2 list

Ask a question - edaboard.com

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony