if you're on CF8, deserializeJSON() should work for each of the entities
enclosed in the {}, which would give you a struct.
i guess the trick is the looping.  can't use a comma as a delimiter since
the JSON entities have commas inside of them.  would a line break/carriage
return work as a delimiter?

assuming you can get a good delimiter, just loop over the dataset and call a
deserializeJSON() for each element, then append the resulting struct to an
array.  that would give you the desired result.

On Mon, Dec 29, 2008 at 9:16 AM, Mike Soultanian <[email protected]> wrote:

> What would be the most efficient way to bring the records listed below
> into CF?   It seems to be in the format of
>
> {field:value,field:value},{field:value,field:value},{field:value,field:value},etc.
> I'm thinking I'd want to build an array of structures?  I figured I post
> this to the list as you would probably know the best functions to use.
> Below are two complete records:
>
>
> {"0":"108265","product_id":"108265","1":"Kenny Hawkes & Joshua
> Iz","artist":"Kenny Hawkes & Joshua Iz","2":"Amabo (Vox
> Mix)","title":"Amabo (Vox Mix)","3":"Berwick Street","label":"Berwick
>
> Street","4":"moody","style":"moody","5":"single","type":"single","6":"1","pg_id":"1","7":"","ep_id":"","8":"2008-12-29","r_date":"2008-12-29","9":null,"pr_date":null,"10":"2008","reg_year":"2008","11":"12","reg_month":"12","12":"29","reg_day":"29","13":"621000","track_time":"621000","14":"12\/29\/2008","date":"12\/29\/2008","15":"108265","image":"108265","16":"108264","compilation_id":"108264","17":"0","pr_flag":"0","price":"
> $1.49\/ $1.99"},
> {"0":"108266","product_id":"108266","1":"Kenny Hawkes & Joshua
> Iz","artist":"Kenny Hawkes & Joshua Iz","2":"Amabo (Dub
> Mix)","title":"Amabo (Dub Mix)","3":"Berwick Street","label":"Berwick
>
> Street","4":"moody","style":"moody","5":"single","type":"single","6":"1","pg_id":"1","7":"","ep_id":"","8":"2008-12-29","r_date":"2008-12-29","9":null,"pr_date":null,"10":"2008","reg_year":"2008","11":"12","reg_month":"12","12":"29","reg_day":"29","13":"531000","track_time":"531000","14":"12\/29\/2008","date":"12\/29\/2008","15":"108266","image":"108266","16":"108264","compilation_id":"108264","17":"0","pr_flag":"0","price":"
> $1.49\/ $1.99"}
>
> My goal is to reference it something like this:
>
> item[0].productid
> item[0].artist
> item[1].productid
> item[1].artist
> and so on...
>
> any thoughts?
>
> Thanks,
> Mike
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317223
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to