Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-17-2012, 04:07 AM   PM User | #1
muriel
New to the CF scene

 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
muriel is an unknown quantity at this point
Question json file to csv

Good day

We are having problem in understanding how would be the structure of this json file(link: http://code.google.com/p/testprogram...rix.json?r=391 ) in an EXCEL. Your help would be highly appreciated.

Thank you
muriel is offline   Reply With Quote
Old 07-17-2012, 10:54 AM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Sorry, but I don't get your question. Your JSON string represents an array of arrays with 35 elements. In Excel you could either put the 35 values in a row or in a column ... this depends on the intended data structure.

For example: You would like to have the 35 values in the same row. So each new entry of the outer array would represent a new row, and each value of the inner array element would represent a column value inside that row.
devnull69 is offline   Reply With Quote
Old 07-18-2012, 06:05 AM   PM User | #3
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,468
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Code:
<script>
r=[
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00020615580539426687,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0.006697839492217511,0.004195012544212019,0.002392362950985978,0.004166244937465728,0.0010882916599248707,0.005024621548810736,0,0,0,0.0002972456999111755,0,0,0,0,0.000215743502273761,0.0014382900151584067,0.001462270547626666,0.0035477639729594983,0.0006808032522768457,0,0.0005081976117990942,0.01030756446432287,0,0.005532683677375547,0.0009492858615495386,0.00085819596703263,0,0,0.0003547763972959499,0.0014238836312462134,0.007378416939103883,0.012498779973475276,0],[0,0,0.0028573865721265874,0.0010307564464322868,0.0010211822978762211,0.0013424130463634651,0.0003979278074153877,0.0014190965569681805,0,0,0,0.00024451110902005296,0,0,0,0,0.00012465360775685237,0.0012225555451002646,0.0006280551130622947,0.0019129329459331762,0.0003451887004164557,0,0.00033560100353696156,0.005187201429951476,0,0.002296485982191037,0.00028765800303168134,0.00023012730564690698,0,0,0,0.0004890041536088679,0.0029484764666434958,0.005038621483020077,0],[0,0,0.0025170075265272115,0.0011985750126320056,0.0008677701155886958,0.0012656843746806552,0.00016780050176848078,0.0014814188447387971,0,0,0,0.00017738819864797494,0,0,0,0,0,0.0007671060725157214,0.0005177717603551599,0.0011793815544417793,0.00034039259392280386,0,0.0002349188960327493,0.004415534088548194,0.00016300439527482897,0.0017019855501530668,0.00025889039628538944,0.00020135969890061506,0,0,0,0.0004027193978012301,0.0024594723130346276,0.004295676587284994,0],[0,0,0.005197136867132299,0.002205396087674128,0.0014382900151584067,0.0024067241738200767,0.0006520356455305537,0.0024978140683369855,0,0,0,0.00025889039628538944,0,0,0,0,0.0002109473957801092,0.00111227219239313,0.0009876276168518964,0.0027567225290536126,0.00044107470142701615,0,0.00045066239830651034,0.00796822061902001,0,0.0033032618961550647,0.000512984686077127,0.00047943000505280223,0,0,0.00018697589552746908,0.0011170592666711627,0.00550378058739497,0.009631954736026908,0],[0,0,0.001840991348528399,0.0006855903265548785,0.00029244959341752363,0.0008006607535400462,0.00018697589552746908,0.0006951644751109444,0,0,0,0,0,0,0,0,0,0.0002780703061521872,0.00020615580539426687,0.0005945004320379699,0.00017738819864797494,0,0,0.0013903289502218887,0,0.000834215434564371,0.00020615580539426687,0,0,0,0,0.00020615580539426687,0.0012465360775685236,0.0020327904471963767,0],[0,0,0.005403071383243901,0.0021478608741815446,0.0012656843746806552,0.002114261032079125,0.0005992875063160028,0.00256496859146373,0,0,0,0.00022533119915325517,0,0,0,0,0.00016300439527482897,0.0010930787342029037,0.0007910414439058858,0.002512220452249179,0.0004650687822187036,0,0.00032601330665746743,0.00648648564673455,0,0.0030156309897702398,0.0004698558564967364,0.0003499848069101075,0,0,0.00013424130463634654,0.0009205182548032468,0.004506623983065103,0.007757318384317995,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00022053960876741282,0,0,0,0.00033560100353696156,0,0.00024451110902005296,0,0,0,0,0,0,0.00018697589552746908,0.00013903289502218886,0],[0,0,0.0004218993076680279,0.00024930269940589525,0.00015821280488898665,0.00024451110902005296,0,0.00026368650277904123,0,0,0,0,0,0,0,0,0,0.00042669089805387017,0.0003451887004164557,0.0007958736792620133,0.0002109473957801092,0,0,0.0010643111274566117,0,0.0005848811224038094,0.00016780050176848078,0,0,0,0,0.00011985750126320056,0.0008054478278180791,0.0005753069738477438,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00016780050176848078,0,0,0,0,0,0,0,0,0,0,0],[0,0,0.00016780050176848078,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00015821280488898665,0,0,0,0.00037874789754858995,0,0.00014382900151584067,0,0,0,0,0,0,0.00015821280488898665,0.00016780050176848078,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00012465360775685237,0,0,0,0.0001965681085147727,0,0,0,0,0,0,0,0,0.00011506139476954876,0.00015341669839533483,0],[0,0,0.00018697589552746908,0.00022533119915325517,0.00014382900151584067,0.00023971500252640112,0,0.00022533119915325517,0,0,0,0.00011985750126320056,0,0,0,0,0.00020615580539426687,0.0006663968683646524,0.00032601330665746743,0.0013567742691975636,0.00027327419965853536,0,0.00024930269940589525,0.0019512747012355339,0,0.0008485766573984697,0,0,0,0,0,0,0.0008869635737789219,0.0008821313384227944,0],[0,0,0.0015245928353972823,0.0013136454396171734,0.000757486762881561,0.000973221232939703,0.0002109473957801092,0.0011890008640759399,0,0,0,0.0004362785949333643,0,0,0,0,0.0006040745805940356,0.0021430286388254166,0.0017067726244310996,0.004909460799669379,0.0010403757560664474,0,0.000915731180525214,0.011065367354751094,0.00042669089805387017,0.0037683306783737685,0.0005848811224038094,0.0004027193978012301,0.00012465360775685237,0,0.0002972456999111755,0.00047943000505280223,0.004708042391367241,0.004257334831982636,0],[0,0,0.001586915123167899,0.000915731180525214,0.0006088616548720685,0.0009636470843836373,0.0002349188960327493,0.001025969372154254,0,0,0,0.0002972456999111755,0,0,0,0,0.00018218430514162676,0.0012704714489586882,0.0007287191561352691,0.0034087581745841666,0.0005753069738477438,0,0.000431487004547522,0.00489004153608868,0,0.002186202629483902,0.0003451887004164557,0.0003308048970433097,0.00011985750126320056,0,0.00014382900151584067,0.0005225588346331928,0.002914921785619171,0.0035286156758473674,0],[0,0,0.0037155825391592175,0.0030060116801360797,0.0014766317704607644,0.0025313687493613104,0.0004842170793308351,0.002454685238756595,0,0,0.0002780703061521872,0.0009492858615495386,0,0.00012944519814269472,0.00012465360775685237,0.00014862510800949248,0.0012273426193782975,0.00512984686077127,0.00372036961343725,0.008298799710672846,0.0025793298142978284,0,0.002775915987243839,0.019714165420657476,0.00029244959341752363,0.00735944928630413,0.000810234902096112,0.0006232680387842618,0.00027327419965853536,0,0.0003451887004164557,0.0010691433628127393,0.008063962104580668,0.009665373933816949,0],[0,0,0.0009253053290812796,0.0005800940481257767,0.0003883355944280841,0.0005225588346331928,0.00011985750126320056,0.0006616097940866194,0,0,0,0.00026368650277904123,0,0,0,0,0.00020615580539426687,0.0013136454396171734,0.0007766802210717871,0.0026464391763464778,0.00025889039628538944,0,0.00044107470142701615,0.003753924294461575,0,0.0016012763460019977,0.00023012730564690698,0.00011985750126320056,0,0,0.00014382900151584067,0.0003308048970433097,0.001836204274250366,0.002732741996585354,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00014862510800949248,0,0,0,0,0,0,0,0,0,0,0],[0,0,0.0009253053290812796,0.0006903774008329114,0.0005034105375210612,0.0006424163358963933,0,0.0007047386236670101,0,0,0,0.0001917720020211209,0,0,0,0,0.0003835440040422418,0.001318432513895206,0.0007095708590231376,0.003749137220183542,0.0006040745805940356,0,0.0006328421873403276,0.006194293471462165,0.00012465360775685237,0.001999235766172052,0.00018218430514162676,0,0,0,0,0.0003883355944280841,0.002905347637063105,0.003955297541685618,0],[0.00011506139476954876,0,0.013304001995902884,0.008270348231473216,0.006213261124261919,0.007143579333011705,0.0013663935788317241,0.008687184982286834,0,0,0.0005561586767356122,0.0015293799096753153,0,0.0003451887004164557,0.0003691602006690958,0.00031162950328432145,0.002425917632010303,0.011558977938325615,0.0062277126692522064,0.022595442203096134,0.003801885359398093,0.00015821280488898665,0.006654484857246647,0.04282760518949924,0.00044587080792066793,0.01687127555459927,0.0016540244852165488,0.0009972017654079621,0.00026368650277904123,0,0.0007910414439058858,0.003394351790671973,0.022125766990911774,0.03680085931776823,0],[0,0,0,0,0.00022533119915325517,0,0,0,0,0,0,0,0,0,0,0,0,0.00029244959341752363,0,0.0003835440040422418,0,0,0,0.0006855903265548785,0,0.00020135969890061506,0,0,0,0,0,0,0.0002972456999111755,0.00034039259392280386,0],[0,0,0.006098551985901509,0.0033080489704330977,0.0017307531568993588,0.0026464391763464778,0.0006663968683646524,0.003399138864950006,0,0,0.00023971500252640112,0.0006424163358963933,0,0,0.00015821280488898665,0,0.0006951644751109444,0.0038881881796369684,0.0027854901357999046,0.007671060725157215,0.0014287158666023408,0,0.001586915123167899,0.016439535648014418,0.00016780050176848078,0.006390744161173892,0.0009396665519153783,0.000810234902096112,0.0001965681085147727,0,0.0006136487291501015,0.001591702197445932,0.008231961315092764,0.010662530538146817,0],[0,0,0.0010643111274566117,0.00044587080792066793,0.0002540988058995471,0.0005897133577599371,0.00012944519814269472,0.0005369652185453861,0,0,0,0.00015341669839533483,0,0,0,0,0,0.0005992875063160028,0.0004890041536088679,0.0009013247966130207,0.0002540988058995471,0,0.00014382900151584067,0.001586915123167899,0,0.0009540729358275716,0.000215743502273761,0.00023012730564690698,0,0,0,0.00022533119915325517,0.0014335029408803737,0.001351987194919531,0],[0,0,0.0006808032522768457,0.0003883355944280841,0.00015821280488898665,0.00025889039628538944,0,0.0002349188960327493,0,0,0,0,0,0,0,0,0,0.0002828618965380295,0.0001965681085147727,0.0005800940481257767,0,0,0,0.0008006607535400462,0,0.0005369652185453861,0.00016780050176848078,0.00013424130463634654,0,0,0,0.00012465360775685237,0.0007143579333011704,0.0006424163358963933,0],[0,0,0.00011985750126320056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00011985750126320056,0.00014382900151584067,0.00022053960876741282,0,0,0,0.00023012730564690698,0,0.0001917720020211209,0,0,0,0,0,0,0.00015821280488898665,0.0001725966082621326,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00014382900151584067,0],[0,0,0.00027327419965853536,0.00016300439527482897,0,0.00020135969890061506,0,0.00011985750126320056,0,0,0,0,0,0,0,0,0,0.0002109473957801092,0.00022053960876741282,0.00033560100353696156,0,0,0,0.0003308048970433097,0,0.00041230709468072425,0,0,0,0,0,0,0.0002780703061521872,0.0003308048970433097,0],[0,0,0.0011458268734174546,0.00044107470142701615,0.0002828618965380295,0.0005945004320379699,0,0.0007622738371595939,0,0,0,0,0,0,0,0,0.00016780050176848078,0.00041710320117437603,0.0002780703061521872,0.0005897133577599371,0.00016300439527482897,0,0.00020135969890061506,0.0020423645957524422,0,0.0008965377223349877,0.00012944519814269472,0,0,0,0,0.00016300439527482897,0.0007383384657694295,0.001160233257329648,0],[0,0,0.004760880852737981,0.0028286189653802954,0.001860184806718625,0.0029101347113411383,0.0005081976117990942,0.002804638432912036,0,0,0.00012944519814269472,0.0005848811224038094,0,0,0.00014862510800949248,0,0.0007479126143254953,0.0034662933880767505,0.0023108472050251353,0.005192169148541887,0.0013040261299830129,0,0.0012656843746806552,0.012053040132681082,0.00013903289502218886,0.005940036601789287,0.0007239320818572362,0.0006040745805940356,0.00014382900151584067,0,0.0002972456999111755,0.000915731180525214,0.005911585122589658,0.006841451720558497,0],[0.00015341669839533483,0,0.01238858694292433,0.006769645606388004,0.0045499786180359676,0.008998796421139918,0.0015821280488898663,0.007795705300698447,0,0,0.00032601330665746743,0.000810234902096112,0,0,0.0004698558564967364,0.0002828618965380295,0.0008533637316765025,0.005211588412122586,0.0031210821071212475,0.009995953025469786,0.002536200984717438,0,0.0029293281695313643,0.028060835874110648,0.00022533119915325517,0.010782207395097639,0.0014814188447387971,0.0006472485712525209,0.00026368650277904123,0,0.0004746429307747693,0.0018458235838845266,0.010811110485078214,0.014119159455511312,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]

//dump to excel
document.body.appendChild(document.createElement("iframe")).src="data:text/csv,"+
 escape(r.join("\n"));

</script>
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote
Reply

Bookmarks

Tags
excel, json

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:43 AM.


Advertisement
Log in to turn off these ads.