This content has been marked as final. Show 3 replies
After a bunch of research, trying to find my answer, maybe I am going about
this the wrong way! Here is what I am trying to do and maybe somebody has a
I am downloading data from the internet that looks like this:
item1|item2|item3 and so on. There will be several hundred items that are
downloaded and each item is seperated by a line break. Currently,
everything is working fine... downloading the data and then putting it into
a list like I mentioned in the last message.
The trick is, if I want to pull up all the list data associated with
item3=mynumber, how would I do that?
item3 is a unique number that I can search by.... Should I put the items
into a text list instead? How would I then search for that value in the
"third position" and display the entire line of data....
Hope I have not confused you even more!
"Bobby Smith" <firstname.lastname@example.org> wrote in message
>I have a list like this:
> [[#Item1: "1", #Item2: "1", #Item3: "83", #Item4: "1", #Item5: "360x420",
> #Item6: "/image1/image1.jpg", #Item7: "/image2/image2.jpg", #Item9:
> "/image3/image3.jpg", #Item9: "image4/image4.jpg", #Item10: "175,996"],
> [#Item1: "1", #Item2: "1", #Item3: "84", #Item4: "2", #Item5: "100x100
> ft", #Item6: "image2.jpg", #Item7: "image3.jpg", #Item8: "image4.jpg",
> #Item9: "image5.jpg", #Item10: "150,000"]]
> This list currently has two data "rows" with 10 "fields" each... however,
> the amount of rows could go up to 200 and constantly change... ITEM3 is a
> unique number and never repeats... how can I write a script that will
> search through this entire list and retrieve all the data for one
> particular "row?"
> For instance, I want to pull up all the data associated with x=ITEM3?
> Thank you for your help in this matter, hopefully I am making sense!
You make contradictory statements about rows and columns. It is difficult to figure out what you are trying to do.
You say, "... how can I write a script that will search through this entire list and retrieve all the data for one particular "row?"
I don't think that is what you meant to say, because to get the data from row three you write: Row3data = TheList
I think you are asking how to get all the data in Column 3. Which would be:
Col3Data = 
repeat with Row in TheList
Use property lists with property based on your key field (item3).
Something like this:
rows = [:]
-- Add row with some data and key 83:
row = [#item1:"Something", #item2:"Something else",#item3:83]
rows[ symbol("id" & row[#item3]) ] = row
--[ #id83:[#item1:"Something", #item2:"Something else",#item3:83]]
--To get a row with id 83 use:
id = 83
put rows[ symbol("id" & id) ]