🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

simon-xlsx2json

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simon-xlsx2json

Convert xlsx to json

latest
Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

node-xlsx-json

Build Status

Converting xlsx file to json files using nodejs

Install

  npm install simon-xlsx2json

Usage

  xlsxj = require("xlsx-to-json");
  xlsxj({
    input: "sample.xlsx", 
    output: "output.json"
  }, function(err, result) {
    if(err) {
      console.error(err);
    }else {
      console.log(result);
    }
  });

Specifying a target sheet

You can optionally provide a sheet name to extract from that sheet

  xlsxj = require("xlsx-to-json");
  xlsxj({
    input: "sample.xlsx", 
    output: "output.json",
    sheet: "tags"
  }, function(err, result) {
    if(err) {
      console.error(err);
    }else {
      console.log(result);
    }
  });

In config object, you have to enter an input path. But If you don't want to output any file you can set to null.

License

MIT @chilijung

jq 操作 json

根据 index 获取数组中的某个元素

cat ./sample/DT_ALL.json | jq '.models | .[1]'

获取数组中某个属性的所有值 cat ./sample/DT_ALL.json | jq '.models | .[].name' "EXCOOL" "PHL402M"

获取 models 数组中 模版名为 EXCOOL 的 对象的 cols 的值 cat ./sample/DT_ALL.json | jq '.models[] | select(.name == "EXCOOL") | .cols' 21 获取 models 数组中 模版名为 EXCOOL 的 对象的 records 的值 cat ./sample/DT_ALL.json | jq '.models[] | select(.name == "EXCOOL") | .records'

获取 excool 中的 某条 Name 为 Adia Pump Overload 的 TextDisplay cat ./sample/DT_ALL.json | jq '.models[] | select(.name == "EXCOOL") | .records[] | select(.Name == "Adia Pump Overload") | .TextDisplay'

同时根据多个条件来检索

使用 rclone 或者 mc 将文件上传到 minio

rclone copy ./sample/DT_ALL.json azure:/opt/model

mc cp ./sample/DT_ALL.json azure:/opt/model

remote->local

mc cp azure:/opt/model/EXCOOL.json ./sample/EXCOOL.json

FAQs

Package last updated on 18 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts