Author Topic: You got your list in my string! No, you got your string in my list!  (Read 1783 times)

0 Members and 1 Guest are viewing this topic.

nivuahc

  • Guest
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)

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: You got your list in my string! No, you got your string in my list!
« Reply #1 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))

nivuahc

  • Guest
Re: You got your list in my string! No, you got your string in my list!
« Reply #2 on: January 18, 2011, 10:12:09 AM »
Bingo. What an idiot that guy was.  :ugly:
   
Danke

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Re: You got your list in my string! No, you got your string in my list!
« Reply #3 on: January 18, 2011, 10:28:00 AM »
Been a while uh Chuck!! LOL
TheSwamp.org  (serving the CAD community since 2003)

nivuahc

  • Guest
Re: You got your list in my string! No, you got your string in my list!
« Reply #4 on: January 18, 2011, 11:11:14 AM »
Been a while uh Chuck!! LOL


Yes, yes it has  :oops: