Knime读取Jason数据
Knime ETL 工具 Jason数据解析到DB
1. 下面例子是一段Jason代码
[{"ID":,"name":"张三","Chinese":,"Math":},{"ID":,"name":"李四","Chinese":,"Math":},{"ID":,"name":"王五","Chinese":,"Math":}]
2. 用文本文件存储上面代码。 test_jason.txt

3. 用File Reader控件读取以上文本文件。

4.添加String to JSON控件。
5. 添加JSON Path控件。

注:JSON Path说明
JSONPath is a similar to XPath alternative for JSON.
The result can be a single value or a list of multiple values (when the path is indefinite). In case there are multiple results and the selected output type cannot handle it (not a list of the selected type, or a JSON) the execution will fail. If the result cannot be represented in the selected type, missing value will be returned.
There are two notations, dot-notation:$.book[1].title and bracket-notation: $['book'][1]['title'] (indexing starts from 0, negative indices are relative to the last element).
Example input:
{"book": [
{"year": 1999,
"title": "Timeline",
"author": "Michael Crichton"},
{"year": 2000,
"title": "Plain Truth",
"author": "Jodi Picoult"}
]}
Example results:
$.book[0]
{"year": 1999, "title":
"Timeline", "author": "Michael Crichton"} (JSON or String
single value)
$.book[*].year
[1999,2000] (JSON,
Int or Real list)
$.book[2].year
? (no such
part)
$.book[?(@.year==1999)].title
Timeline
(String) or "Timeline" (JSON)
The default path ($..*) will select all possible subparts (excluding
the whole JSON value).
When you request the paths instead of values for the $.book[0].*
JSONPath, you will get the paths -in bracket notation- as a list of Strings:
- $['book'][0]['year']
- $['book'][0]['title']
- $['book'][0]['author']
which are valid JSONPaths for the input
JSON value.
The filters ?(expr)can be used to select contents with specific
properties, for example $..book[?(@.publisher)] selects the books that
specify their publisher (@ refers to the actual element).
It uses the jayway/JsonPath implementation.
Knime读取Jason数据的更多相关文章
- jasoncpp读取jason数据如何判断某一字段是否存在
如标题,使用json_data.isMember("XXX")来判断 jason_data["XXX"].isNull()是用来判断“XXX”字段后边的值是否为 ...
- ajax读取json数据
首先建立json.txt文件 { "programmers": [ { "firstName": "Brett", "lastNa ...
- java的poi技术读取Excel数据到MySQL
这篇blog是介绍java中的poi技术读取Excel数据,然后保存到MySQL数据中. 你也可以在 : java的poi技术读取和导入Excel了解到写入Excel的方法信息 使用JXL技术可以在 ...
- Hive读取外表数据时跳过文件行首和行尾
作者:Syn良子 出处:http://www.cnblogs.com/cssdongl 转载请注明出处 有时候用hive读取外表数据时,比如csv这种类型的,需要跳过行首或者行尾一些和数据无关的或者自 ...
- 读取数据库数据,并将数据整合成3D饼图在jsp中显示
首先我将生成饼图的方法独立写成一个PieChar.java类,详细代码如下:(数据库需要自己建,如有需要的话) import java.io.IOException; import java.sql. ...
- .NET读取Excel数据,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序
解决.NET读取Excel数据时,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序的操作: 1. 检查本机是否安装Office Access,如果未安装去去h ...
- oledbdataadapter 读取excel数据时,有的单元格内容不能读出
表现:excel中某列中,有的单元格左上角有绿色箭头标志,有的没有,c#编写读取程序,但是只能读取出带绿色箭头的单元格中的内容,其余不带的读取不到内容 原因:excel中单元格因为是文本格式而存储了数 ...
- wcf序列化大对象时报错:读取 XML 数据时,超出最大
错误为: 访问服务异常:格式化程序尝试对消息反序列化时引发异常: 尝试对参数 http://tempuri.org/ 进行反序列化时出 错: request.InnerException 消息是“反序 ...
- Openxml入门---Openxm读取Excel数据
Openxml读取Excel数据: 有些问题,如果当Cell 里面是 日期和浮点型的话,对应的Cell.DataType==Null,对应的时间会转换为一个浮点型,对于这块可以通过DateTime.F ...
随机推荐
- 黑盒测试实践-小组任务分配和安排-Day01
实践作业2:黑盒测试实践 小组成员 组长:华同学 成员:覃同学.沈同学.刘同学.郭同学.穆同学 任务分解 任务1:分析系统需求 参考软件需求规格说明书模板描述系统需求.如果系统功能特别多,特别复杂,则 ...
- 20169219 实验四Android程序设计
一.实现Linux下dc的功能,计算后缀表达式的值 public int evaluate(String expr) { int op1, op2, result = 0; String token; ...
- MongoDB单表导出与导入
mongoexport -h -u dbAdmin -p L-$LpGQ=FJvSf*****([l --authenticationDatabase=project_core_db -d proje ...
- 使用VS Code开发C++
1. 参考/转载 vs code进行c/c++开发 VSCode 的第一个C++程序(windows)[更新2018.10.28] 2. C++开发相关插件(扩展商店中直接搜索) 至少要装C/C++. ...
- Kylin存储和查询的分片问题
本文来自网易云社区 作者:汪胜 相关概念介绍 为了了解Kylin存储和查询的分片问题,需要先介绍两个重要概念:segment和cuboid.相信大数据行业的相关同学都不陌生.Kylin每次提交一个新的 ...
- mysql 行转列,对列的分组求和,对行求和
CREATE TABLE students( id INT PRIMARY KEY, NAME VARCHAR(11)); CREATE TABLE courses( id INT PRIMARY K ...
- ajax-3验证
$("#formBtn").click(function () { // var regName =/^[\u4e00-\u9fa5]{2,10}$/;//姓名只能是汉字切2-10 ...
- selenium+PhantomJS简单爬虫
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2017年10月19日 @author: zzy ''' import tim ...
- 伪元素改变date类型input框的默认样式实例页面
CSS代码: ::-webkit-datetime-edit { padding: 1px; background: url(/study/image/selection.gif); } ::-web ...
- mysql自动备份并上传至git仓库
自动备份 备份需求 数据库备份的重要性再怎么强调也不为过.当你的操作出现差错,但又因为没有作备份导致数据无法还原时,你就能体会到“万念俱灰”的心情了. 数据库备份有多种形式,本文以我的个人网站数据 ...