PDA

View Full Version : Need Conversion string to list



avinash00002002
2010-01-06, 11:43 AM
Dear All,

Can anyone help to out conversion string to list

"1 345233 12748382 2.3"
"2 345372 12759385 1.9"

or

"1,345233,12748382,2.3"
"2,345372,12759385,1.9"

David Bethel
2010-01-06, 12:38 PM
Something like this works:

(setq lst (read (strcat "(" "1 3 5" ")" )))

You could change the comma delimiter to a space. -David

RobertB
2010-01-06, 05:10 PM
Something like this works:

(setq lst (read (strcat "(" "1 3 5" ")" )))Yikes.

Read can be fraught with issues.

You can use the attached toolbox routine to parse a string into a list using any delimiter.