TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: nivuahc on January 18, 2011, 09:52:23 AM

Title: You got your list in my string! No, you got your string in my list!
Post by: nivuahc on January 18, 2011, 09:52:23 AM
So I'm having a little difficulty making my brain work this morning and would appreciate some nudging.

I've got a text file filled with information like this, each item on a separate line:

Code: [Select]
("3001" "P-PP44-31" "1.00" (349.739 214.935 1934.28) (583.66 214.935 1934.28))
The jerk who created this data file didn't think about the fact that, when he tries to read each line, he'll get the line as a string ala

Code: [Select]
"(\"3001\" \"P-PP44-31\" \"1.00\" (349.739 214.935 1934.28) (583.66 214.935 1934.28))"
See, this idiot had this idea to be able to search through the information in this data file and retrieve the nth item from the returned list on a given line...  :realmad:

So either this idiot needs to write that data out in a different format, or this jerk needs to be able to convert that string into a list like he originally intended.

Help me Okie Wan Fenokie, you're my only hope. :(


Thank you very much.

Chuck (the aforementioned jerk/idiot)
Title: Re: You got your list in my string! No, you got your string in my list!
Post by: ElpanovEvgeniy on January 18, 2011, 09:54:48 AM
Code: [Select]
(read "(\"3001\" \"P-PP44-31\" \"1.00\" (349.739 214.935 1934.28) (583.66 214.935 1934.28))")
;; =>> ("3001" "P-PP44-31" "1.00" (349.739 214.935 1934.28) (583.66 214.935 1934.28))
Title: Re: You got your list in my string! No, you got your string in my list!
Post by: nivuahc on January 18, 2011, 10:12:09 AM
Bingo. What an idiot that guy was.  :ugly:
   
Danke
Title: Re: You got your list in my string! No, you got your string in my list!
Post by: Mark on January 18, 2011, 10:28:00 AM
Been a while uh Chuck!! LOL
Title: Re: You got your list in my string! No, you got your string in my list!
Post by: nivuahc on January 18, 2011, 11:11:14 AM
Been a while uh Chuck!! LOL


Yes, yes it has  :oops: