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 ...
随机推荐
- IE浏览器和Firefox浏览器兼容性问题及解决办法
IE浏览器和Firefox浏览器兼容性问题及解决办法 为了方便大家阅读代码,以下以 IE 代替 Internet Explorer,以 MF/FF 代替 Mozzila Firefox : 1.//w ...
- Model View Controller (MVC) Overview
By Rakesh Chavda on Jul 01, 2015 What is MVC?Model View Controller is a type of user interface archi ...
- 如何恢复VS2013代码实时校验功能
VS2013在某一天突然无法进行实时代码校验了,只有在编译的时候,错误列表才显示语法错误 怎么来解决这个问题呢?试试环境重置吧. 首先:打开工具菜单,选择“导入和导出设置”. 其次:可以先导出选定 ...
- 关于AJAX与JSON的杂记
一.当网页需要有多个XMLHttpRequest对象时,可以使用Callback 函数,callback 函数是一种以参数形式传递给另一个函数的函数. <html> <head> ...
- delphi 金额大小写转换函数
{*------------------------------------------------ 金额大小写转换函数 @author 王云盼 @version V1506.01 在delphi7测 ...
- aspx 与 ashx cs
1. aspx 与 ashx 我们知道 aspx :继承自 System.Web.UI.Page 然而Page:IHttpHandler public class Page : TemplateCon ...
- .net IAsyncResult 异步操作
//定义一个委托 public delegate int DoSomething(int count); //BeginInvoke 的回调函数 private static void Execute ...
- .net 基元类型,引用类型和值类型
基元类型(primitive type): 编译器直接支持的数据类型称为基元类型(primitive type). string 与 String: 由于C#中的string (一个关键字)直接映射到 ...
- CentOS7 yum安装lamp环境
1.安装apache yum install httpd #根据提示,输入Y安装即可成功安装 systemctl start httpd.service #启动apache systemctl sto ...
- raiden_graph
使用mermaid描述 raiden 通道 AB,正常状态 graph LR A-- 60,100,S_100 ---B 通道 AB closed graph LR A((A)) -. 60,100 ...