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数据的更多相关文章

  1. jasoncpp读取jason数据如何判断某一字段是否存在

    如标题,使用json_data.isMember("XXX")来判断 jason_data["XXX"].isNull()是用来判断“XXX”字段后边的值是否为 ...

  2. ajax读取json数据

    首先建立json.txt文件 { "programmers": [ { "firstName": "Brett", "lastNa ...

  3. java的poi技术读取Excel数据到MySQL

    这篇blog是介绍java中的poi技术读取Excel数据,然后保存到MySQL数据中. 你也可以在 : java的poi技术读取和导入Excel了解到写入Excel的方法信息 使用JXL技术可以在 ...

  4. Hive读取外表数据时跳过文件行首和行尾

    作者:Syn良子 出处:http://www.cnblogs.com/cssdongl 转载请注明出处 有时候用hive读取外表数据时,比如csv这种类型的,需要跳过行首或者行尾一些和数据无关的或者自 ...

  5. 读取数据库数据,并将数据整合成3D饼图在jsp中显示

    首先我将生成饼图的方法独立写成一个PieChar.java类,详细代码如下:(数据库需要自己建,如有需要的话) import java.io.IOException; import java.sql. ...

  6. .NET读取Excel数据,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序

    解决.NET读取Excel数据时,提示错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序的操作: 1. 检查本机是否安装Office Access,如果未安装去去h ...

  7. oledbdataadapter 读取excel数据时,有的单元格内容不能读出

    表现:excel中某列中,有的单元格左上角有绿色箭头标志,有的没有,c#编写读取程序,但是只能读取出带绿色箭头的单元格中的内容,其余不带的读取不到内容 原因:excel中单元格因为是文本格式而存储了数 ...

  8. wcf序列化大对象时报错:读取 XML 数据时,超出最大

    错误为: 访问服务异常:格式化程序尝试对消息反序列化时引发异常: 尝试对参数 http://tempuri.org/ 进行反序列化时出 错: request.InnerException 消息是“反序 ...

  9. Openxml入门---Openxm读取Excel数据

    Openxml读取Excel数据: 有些问题,如果当Cell 里面是 日期和浮点型的话,对应的Cell.DataType==Null,对应的时间会转换为一个浮点型,对于这块可以通过DateTime.F ...

随机推荐

  1. poj 1988 Cube Stacking (并查集)

    题意:有N(N<=30,000)堆方块,开始每堆都是一个方块.方块编号1 – N. 有两种操作: M x y : 表示把方块x所在的堆,拿起来叠放到y所在的堆上. C x : 问方块x下面有多少 ...

  2. Responsive设计——meta标签

    media-queries.js(http://code.google.com/p/css3-mediaqueries-js/) respond.js(https://github.com/scott ...

  3. markdown的图片外链

    markdown的图片用本地的很不方便,今天试用了一下七牛的服务,感觉很好用.推荐一下,免费的服务够用并且比较友好.

  4. Alternative to iPhone device ID (UDID)

    Alternative to iPhone device ID (UDID) [duplicate] up vote10down votefavorite 3 Possible Duplicate:U ...

  5. 编写高质量代码改善C#程序的157个建议——建议48:Dispose方法应允许被多次调用

    建议48:Dispose方法应允许被多次调用 一个类型的Dispose方法应该允许被多次调用而不抛出异常.鉴于此,类型内部维护了一个私有的bool变量disposed,如下: private bool ...

  6. 微软和Google的盈利模式对比分析

    一: 微软和Google是世界上最成功科技巨头之一,但他们之间却有着不同的产品和业务,二者的盈利方式也各有不同,本文将分析和探讨的二者盈利模式的异同. 微软的盈利模式 在1975年由大学肄业的Bill ...

  7. C# return、continue、break

    return 终止当前进程 可用循环判断,验证,等功能 if (ew == v) { PublicControlLib.Class.PublicProperties.ShowSuccess(); re ...

  8. SQL Server 常用函数总结

    SQL去空格函数 1.ltrim(‘内容’)--去掉字符左边的空格 代码如下 declare @str varchar(100) set @str=' ADFADF' select @str sele ...

  9. Expression表单式树

    余于项目中逢Expression(表达式树),然今未明其用途也,记之以温. using System; using System.Collections.Generic; using System.L ...

  10. C# 根据论文 像素差异算法【个人实验还是比较好使的】

    论文地址:http://www.docin.com/p-1081596986.html 具体代码: 我转YUV,再通过上面的论文的方式比较近. YVU 介绍:https://blog.csdn.net ...