Tag: json

使用php pdo将JSON转换为Excel文件

我有这个文件给我从MySQL数据库的JSON输出: <?php require 'core/init.php'; $general->logged_out_protect(); $username = htmlentities($user['username']); $user_id = htmlentities($user['id']); try { $result = $db->prepare('SELECT ID,br,sufiks,kupac,datum,rok,status FROM racuni WHERE user_id=:user_id'); $result->bindParam(':user_id', $user_id); $result->execute(); //$res = $result->fetchAll(PDO::FETCH_ASSOC); /* Extract the information from $result */ foreach($result as $r) { $temp = array(); // the following line will be used to slice the Pie chart $temp['ID'] = […]

如何让(“字段”)在VBA-JSON中工作

概要 我试图访问我目前正在使用的API的深层嵌套JSON。 通过这个过程使用VBA-JSON非常简单,但我遇到了一个小小的障碍。 在大多数情况下,我已经有了这个库可以正常工作,但是当我尝试抓取嵌套在JSON响应中的项目( 超过2个JSON级别 )时,我得到一个错误。 我将提交这个post,然后我会去收集一些我得到的错误代码。 closures我的头顶,我知道当我尝试使用下面的代码无法运行时,运行时错误为'13' 。 我认为( 可能是错误的 ),我很聪明,以了解types不匹配的错误,但我不知道如何解决它。 这工作 For i = 1 To 20 ActiveSheet.Cells(i + 1, 5) = Json("issues")(i)("key") ActiveSheet.Cells(i + 1, 6) = Json("issues")(i)("id") Next 不起作用 For i = 1 To 20 ActiveSheet.Cells(i + 1, 7) = Json("fields")(i)("summary") Next 这些没有任何工作 ActiveSheet.Cells(i + 1, 7) = Json("fields")(i)("summary") ActiveSheet.Cells(i + […]

将excel数据保存到couchDB

我想知道是否有一个工具,将保存/推我的MS Excel(或OO计算)数据到CouchDB数据库。 谷歌search没有什么帮助,所以我不认为有一个现有的解决scheme。 Excel – > JSON – >curl到CouchDB会做的伎俩,但我仍然希望有什么可以节省我的时间编程。

用以后可以处理的greasemonkey存储或login数据

我正在忙于一个网站,我想写一个logging所有数据,或者至less某些位置的greasemonkey脚本,并保存在一个文件中,这将是excell的interperatable。 那可能吗? 说例如我拿这个数据片段: {"d":[["","","y","ZAR","1","49517","6458, 8270, 8270, 8270, 7635",null,"1.40","6458","0:13:30","","12","","C","30",null],["y","-00:00","y","ZAR","2","49593","6458, 6458, 6458, 6458, 6458",null,"2.92","6458","0:13:37","","12","","L","12","Ve4mYdrvkkQMKxBH1\/1VMtDTCDQBRspg5jB8jjY08zg="],["","","y","ZAR","3","49058","7456, 9216, 6458, 5153, 7456",null,"194.40","7456","0:00:31","","1100","","T",null,null],["","","y","ZAR","4","49597","2935, 6554",null,"1.22","2935","0:01:16","","12","","T",null,null],["","","y","ZAR","5","49590","4440, 0518, 5343, 2625, 4848",null,"0.95","4440","0:15:58","","5","","L",null,null],["","","y","ZAR","6","49591","4848, 4440, 4440, 0518, 2625",null,"1.81","4848","0:16:05","","12","","L",null,null],["","","y","ZAR","7","49595","6458",null,"5.55","6458","0:04:13","","55","","T",null,null],["","","y","ZAR","8","49596","",null,"2.90","NONE","0:04:35","","29","","T",null,null],["","","y","ZAR","9","49496","6458, 2427, 2427, 7863, 5845",null,"2.56","6458","0:06:07","","10","","B",null,null],["","","y","ZAR","10","49524","6458, 2427, 7863, 7863, 5845",null,"1.67","6458","0:06:00","","5","","B",null,null],["","","y","ZAR","11","49539","6458, 2427, 7863, 7863, 0764",null,"2.02","6458","0:04:25","","10","","B",null,null]]} ,把它读成一个二维数组,这是Brock Adams帮助我的。 var myJson = '{"d":[["","","y","ZAR","1","49517","6458, 8270, 8270, 8270, 7635",null,"1.40","6458","0:13:30","","12","","C","30",null],["y","-00:00","y","ZAR","2","49593","6458, 6458, 6458, 6458, 6458",null,"2.92","6458","0:13:37","","12","","L","12","Ve4mYdrvkkQMKxBH1\/1VMtDTCDQBRspg5jB8jjY08zg="],["","","y","ZAR","3","49058","7456, 9216, 6458, 5153, 7456",null,"194.40","7456","0:00:31","","1100","","T",null,null],["","","y","ZAR","4","49597","2935, […]

将嵌套的JSON(mixpanel API原始数据导出)转换为CSV? (理想的Python)

我已经收到来自Mixpanel API的原始数据。 我希望将其转换为CSV文件,以便我可以在Excel中操作数据。 我已经尝试过这个在线工具( http://jsfiddle.net/sturtevant/vUnF9/ ),但它似乎不处理嵌套的JSON结果。 做这个的最好方式是什么? 这里是输出示例: {"event":"Event.Name","properties":{"time":1376784014,"distinct_id":"distinctID","$app_version":"1.XX","$city":"cityName","$ios_ifa":"iosIfa","$lib_version":"XYZ","$manufacturer":"Apple","$model":"model","$os":"iPhone OS","$os_version":"XYZ","$region":"Region","$screen_height":999,"$screen_width":999,"$wifi":true,"App Version":"1.XX","BattleDuration":"99","BattleNum":"2","Episode Num":"2","PlayerVictory":"1","mp_country_code":"CODE","mp_device_model":"Model","mp_lib":"iphone"}}

用VBJSON遍历嵌套对象

我正在尝试通过VBA连接到SmartSheet API以将内容拖入Excel工作表中。 我发现VBJSON库已经帮了我一些,但我正在努力迭代通过对象和拉特定的值。 我想要访问每个行的“Value”属性的内容,然后对后续行执行相同的操作。 我最大的问题是,我不知道这个VBJSON库如何工作,因为我找不到任何文档,只有几个例子,他们处理相对简单的JSON示例。 期望的输出 第1行第1列内容| 第1行第2列内容 第2行第1列内容| 第2行第2列内容 JSON { "id": 1, "name": "Sheet Name", "columns": [ { "id": 1, "index": 0, "title": "Title of Column", "type": "TEXT_NUMBER", "primary": true }, { "id": 2, "index": 1, "title": "Title of Second Column", "type": "TEXT_NUMBER" }, ], "rows": [ { "id": 1, "rowNumber": 1, "cells": […]

Json来使用java优化转换

我已经创build了一个应用程序转换JSON到Excel,代码工作正常,但没有写入Excel表生成。 任何人都可以告诉我这个原因。 excel转换的jxl库 我的代码如下 public static void majin(String[] args) throws Exception { WritableWorkbook wworkbook; wworkbook = Workbook.createWorkbook(new File("C:/SWD.csv")); WritableSheet wsheet = wworkbook.createSheet("SWD", 0); WritableFont cellFont = new WritableFont(WritableFont.TIMES, 12); cellFont.setColour(Colour.BLACK); WritableCellFormat cellFormat = new WritableCellFormat(cellFont); cellFormat.setBackground(Colour.WHITE); cellFormat.setBorder(Border.ALL, BorderLineStyle.THIN); Label label = new Label(0, 0,"mydata",cellFormat); wsheet.setColumnView(0, 18); wsheet.addCell(label); }

Excel VBA – 如何从多个数组JSON中获取数据到列中

我发现了一个parsingJSON的解决scheme,并且对于这个例子来说工作的很好: 代码如下: Sub Test() Dim jsonText As String Dim jsonObj As Dictionary Dim jsonRows As Collection Dim jsonRow As Collection Dim ws As Worksheet Dim currentRow As Long Dim startColumn As Long Dim i As Long Set ws = Worksheets("VIEW") 'Create a real JSON object jsonText = ws.Range("A1").Value 'Parse it Set jsonObj = JSON.parse(jsonText) 'Get […]

JSON格式要优秀

我有一个在JSOn格式的回应,有没有什么办法,我可以将其转换成Excel表单与我的网页上点击button? “abcd”“business desc”“John”“Analyst”“abc@yahoo.com”“(xxx)xxx-xxxx”“2”“167600” 谢谢!

AngularJS – button – 依赖前的调用函数或指令

我正在使用ngJsonExportExcel依赖项将JSON导出到EXCEL。 我有一个其他的PHP文件,根据推button从sql中获取数据,以及我想要导出的数据。 导出是由于button的属性而发生的。 我想要发生的是,当我按下button时,它首先加载数据,然后导出。 这是AngularJS: $scope.Export_to_csv = function (odid,hour) { $http.get("fetch-sms-list.php?odid="+odid+"&hour="+hour) .success(function (data) { $scope.smslist=data.result; }); } 这是button(在表中): <tr ng-repeat="row in records | orderBy: sortType : sortReverse"> <td>{{ $index +1 }}</td> <td>{{row.pname + " " + row.sname}}</td> <td>{{row.areaname}}</td> <td>{{row.oddate}}</td> <td>{{row.odtime}}</td> <td><button ng-click="Export_to_csv(row.ODid,row.odtime)" ng-json-export-excel data="smslist" report-fields="{'fname': 'Heder 1', 'sname': 'Header 2'}" filename =" 'export-excel' " separator="," […]