Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
json2table
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
json2table
Commits
64d187a9
There was an error fetching the commit references. Please try again later.
Commit
64d187a9
authored
3 years ago
by
Recolic K
Browse files
Options
Downloads
Patches
Plain Diff
gg
parent
d19247fb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+64
-0
64 additions, 0 deletions
README.md
with
64 additions
and
0 deletions
README.md
0 → 100644
+
64
−
0
View file @
64d187a9
# json2table
Convert huge annoying json to table.
Build it with
`make`
## Usage
```
cat huge.json | json2table /all/users
curl -s 'https://config.edge.skype.net/annoying-json-api' | json2table /M365FleetAGC/AG98/Buildout/Stage0/AzureResources/KeyVault/TorusKeyVault
```
## Why use this tool
Because I'm silly and naive. For example, you have this json:
```
{
"vm": [
{"username": "he,llo", "ip": "1.1.1.1", "password": "n,oob"},
{"username": "hello", "ip": "1.1.1.1", "password": "b"},
{"username": "hell,o4", "ip": "12.1.1.1", "password": "noob"},
{"username": "hello", "ip": "1.1.1.1", "password": "oob"},
{"username": "hel,lo4", "ip": "1.21.1.1", "password": "noob"},
{"username": "hello", "ip": "1.1.21.1", "password": "no,,ob"},
{"username": "hello", "ip": "1.1.21.1", "password": "noob"},
{"username": "he,llo4", "ip": "1.1.21.1", "password": "noo2b"},
{"username": "hello", "ip": "1.12.12.1", "password": "no2,,,ob"},
{"username": "he,llo5", "ip": "1.21.1.1", "password": "noob"},
{"username": "hello", "ip": "1.1.1.1", "password": "noob"},
{"username": "hello3", "ip": "1.12.1.1", "password": "no222ob"},
{"username": "hello", "ip": "1.1.1.1", "password": "noo,,,22b"},
{"username": "hello", "ip": "1.1.12.1", "password": "noob"},
{"username": "hello1", "ip": "1.1.1.1", "password": "no2ob"},
{"username": "he,llo", "ip": "1.12.1.1", "password": "n2oo,,b"},
{"username": "hello1", "ip": "1.1.1.1", "password": "noo2b"},
{"username": "hello", "ip": "1.12.1.1", "password": "noo22b"},
{"username": "he,llo", "ip": "1.12.21.1", "password": "no22o,,b"},
{"username": "hello", "ip": "1.1.1.21", "password": "noob"},
{"username": "hel,lo1", "ip": "1.1.1.21", "password": "no2ob"},
{"username": "he,llo11", "ip": "1.1.1.21", "password": "2noob,,,"}
]
}
```
How could you get the table easily in commandline? No way! That's why I created this silly tool to fuck it.
Another example, you have this json, it looks like a table:
```
[{
"users": [{"nobody":[[{"shit1":1, "shit2":2, "shit3":3}]]}]
}]
```
If you use jq or other tools, you have to write
`json[0]['users'][0]["nobody"][0][0]["shit1"]`
, but you can write
`json/users/nobody/shit1`
here.
## WARNING
**The code in this repo is very very silly, it's completely a mess! I have warned you, DO NOT try to read or fix or understand the code.**
I even didn't write a document for it. Then you know how silly it is!
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment