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 ...
随机推荐
- 运行monitor提示需要安装旧JAVA SE 6运行环境
MAC系统下运行monitor命令 ➜ tools git:(master) ✗ monitor 提示如下: 若要打开Eclipse.app,您需要Java SE 6 runtime,您想现在安装一个 ...
- [redis]redis-cluster的使用
1.为集群添加一个主节点 首先准备一个全新的redis文件夹,这里我们叫做为7007 [root@CentOS7 redis-cluster]# ls [root@CentOS7 redis-clus ...
- javascrip总结12:逻辑运算符与等号运算符
1 逻辑运算符 逻辑运算的结果只有true 或者 false. 1.1 与&&: 两个表达式为true的时候,结果为true. 1.2 或|| 只要有一个表达式为true,结果为tru ...
- 编写高质量代码改善C#程序的157个建议——建议33:避免在泛型类型中声明静态成员
建议33:避免在泛型类型中声明静态成员 在上一建议中,已经理解了应该将MyList<int>和MyList<string>视作两个完全不同的类型,所以,不应该将MyList&l ...
- 如何恢复VS2013代码实时校验功能
VS2013在某一天突然无法进行实时代码校验了,只有在编译的时候,错误列表才显示语法错误 怎么来解决这个问题呢?试试环境重置吧. 首先:打开工具菜单,选择“导入和导出设置”. 其次:可以先导出选定 ...
- 简单好用的表单校验插件——jQuery Validate基本使用方法总结
jquery validate当前最新版本是1.17.0,下载链接是:https://github.com/jquery-validation/jquery-validation/releases/t ...
- Java集合类总结 (三)
HashSet类 关于HashMap的实现细节 HashMap是用LinkedList实现的,每个list被称为一个桶(bucket),在hashmap中要查找一个元素,首先对传入的key进行散列,并 ...
- kubernetes 1.3管中窥豹- RS(Replica Sets):the next-generation Replication Controller
前言 kubernates 1.3出了几个新的概念,其中包括deployments,Replica Sets,并且官网称之为是the next-generation Replication Contr ...
- Go环境搭建(Windows)
下载MSI MSI地址 配置环境变量 GOPATH: 用于存放Go语言Package的目录,这个目录不能在Go的安装目录中 GOBIN: Go二进制文件存放目录,写成%GOROOT%\bin就好 PA ...
- 《Java多线程编程实战指南+设计模式篇》笔记
线程的监视:工具:jvisualvm.exe 命令:jstack PID 原子性: volatile关键字: 显示锁:人为实现的程序员可控制的锁,包括synchronized和Lock下的实现类: 线 ...