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
7564f4d0
There was an error fetching the commit references. Please try again later.
Commit
7564f4d0
authored
2 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
windows newline fix
parent
6cbc2691
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
json2table.cc
+4
-2
4 additions, 2 deletions
json2table.cc
test/answers
+40
-0
40 additions, 0 deletions
test/answers
with
44 additions
and
2 deletions
json2table.cc
+
4
−
2
View file @
7564f4d0
...
...
@@ -76,7 +76,7 @@ void naive_json_access_path(json &input, rlib::string json_path) {
int
main
(
int
argc
,
char
**
argv
)
{
rlib
::
opt_parser
args
(
argc
,
argv
);
if
(
args
.
getBoolArg
(
"-h"
,
"--help"
))
{
rlib
::
println
(
"json2table version 1.0.6, maintainer Recolic Keghart <root@recolic.net>"
);
rlib
::
println
(
"json2table version 1.0.6
-2
, maintainer Recolic Keghart <root@recolic.net>"
);
rlib
::
println
(
"Usage: cat xxx.json | json2table"
);
rlib
::
println
(
"Usage: curl https://myapi/getJson | json2table /path/to/subobject"
);
rlib
::
println
(
"Set --programming / -p to make the output easier for program to process. "
);
...
...
@@ -142,7 +142,9 @@ int main(int argc, char **argv) {
if
(
program_mode
)
{
for
(
auto
&
row
:
rows
)
{
if
(
!
row
.
empty
())
rlib
::
println
(
rlib
::
printable_iter
(
row
,
"|"
));
if
(
!
row
.
empty
())
// Print \n instead of \r\n in Windows. Not using println.
std
::
cout
<<
rlib
::
printable_iter
(
row
,
"|"
)
<<
'\n'
;
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
test/answers
+
40
−
0
View file @
7564f4d0
...
...
@@ -118,3 +118,43 @@ f75cc9cbc7c5da5d5fc8d755b47c823f86e5ea5752978fcd822bfc6022e1ccb4LS0gMi5qc29uIC9p
772fd278789db1083f8701aeae35405f898d74f778ed0eb9ae13c4a9198d85fcLS0gMy5qc29uIC9wYXlsb2FkL2NvbW1pdHMsaGVhZCxhY3Rpb24gLXAK
2ee6cffe37ad185bb27ef0342dd4d1d77a985d8b4f5edbfbdd2d367b303b33d0LS0gMy5qc29uIC9wYXlsb2FkL2NvbW1pdHMgLXAK
be9ac75fe4781b6312aa0fda78b392f7e4b3ca5099178d723f1e7e5f7312e777LS0gMy5qc29uIC9wYXlsb2FkIC1wCg==
eddd2b0e92a945d57ab9839fed3c9bf87959d2add44aeb51ae0229cc2161e59bLS0gMS5qc29uCg==
eddd2b0e92a945d57ab9839fed3c9bf87959d2add44aeb51ae0229cc2161e59bLS0gMS5qc29uIC8K
2584d1bb97716b31c10dff8101f89cce44fc701c1e0f131c8fcfdf54cf676577LS0gMS5qc29uIC92bQo=
1270bc1b13697864430f4e3f2e8f5de52ee1310dda481e6a57c99f428993a704LS0gMS5qc29uIC92bS9pcAo=
56251ba3cc320dcd1957a9db873cc0af83b837424b955d11c667e1a0a369e426LS0gMS5qc29uIC92bS9pcCxwYXNzd29yZAo=
91b8ad2db04e03db9303a63fc438f63f1a42e73f6c5df217b75a536db1066fadLS0gMS5qc29uIC92bSxub25lCg==
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855LS0gMS5qc29uIC92bS9pcC9ub25lCg==
8f44fe1892d8187d2913ba3c2617316127bf5baddebcd72cf7f52dfebe015912LS0gMS5qc29uIC92bS9pcCxwYXNzd29yZC9ub25lCg==
9f41a045de1f52a8a4c84ff3a63118c840ae688c7553488f325c166785b7b795LS0gMS5qc29uIC92bSxub25lL2lwCg==
b4533daf1ad1158d225080e07fea718a0d3965145f97a4ca3be0e23770c960ceLS0gMi5qc29uIC8K
6d6e68e7f011578510e85ecc09b57e3bd81f33597ef6bc023d0d4e93ffb81e6bLS0gMi5qc29uIC9sYWJzCg==
3595d312d7408df409676b22c147518960e99e782b9c285408b5303b20cb15a6LS0gMi5qc29uIC9tZWRpY2F0aW9ucwo=
9f41a045de1f52a8a4c84ff3a63118c840ae688c7553488f325c166785b7b795LS0gMi5qc29uIC9sYWJzLG1lZGljYXRpb25zL25hbWUK
d4a34dda74c406509710eb71f5477eb2a26c16f5b4c582e9ed6c303c50e84379LS0gMi5qc29uIC9tZWRpY2F0aW9ucy9taW5lcmFsCg==
d4a34dda74c406509710eb71f5477eb2a26c16f5b4c582e9ed6c303c50e84379LS0gMi5qc29uIC9tZWRpY2F0aW9ucy9taW5lcmFsLwo=
b4533daf1ad1158d225080e07fea718a0d3965145f97a4ca3be0e23770c960ceLS0gMi5qc29uIC8vLy8vLy8K
9f41a045de1f52a8a4c84ff3a63118c840ae688c7553488f325c166785b7b795LS0gMi5qc29uIC9pbWFnaW5nLGxhYnMvbG9jYXRpb24K
6a818e255df1318ab0e8843a6ab8e982412a42783ac042eb01af9da9588062ffLS0gMy5qc29uIC9wYXlsb2FkL2NvbW1pdHMsaGVhZCxhY3Rpb24K
9080ad4e3ee274e74e9e3511faa3e0c521dfe8efceea2323f93755eadfc5b15eLS0gMy5qc29uIC9wYXlsb2FkL2NvbW1pdHMK
42491c878f7445bdc40bee09cc567c1847c555d5cdb8031e25c1d61297445e77LS0gMy5qc29uIC9wYXlsb2FkCg==
eddd2b0e92a945d57ab9839fed3c9bf87959d2add44aeb51ae0229cc2161e59bLS0gMS5qc29uCg==
c187f7579a7ec175e96c3aa3facda83a050d6ce128967f0c411f8400fc73d8e8LS0gMS5qc29uIC8gLXAK
b065cfeaf631b84ccfc70d6c95a9522f5fc777e09073b412f8f8dedd05a117fcLS0gMS5qc29uIC92bSAtcAo=
e42abffd06981e2662c3a78380b7040165da30510d5ae490cb1309fba05211adLS0gMS5qc29uIC92bS9pcCAtcAo=
a22709b2f14711edd71d6d416127ed795b97f1707eec88ab8d38ec807c9292a1LS0gMS5qc29uIC92bS9pcCxwYXNzd29yZCAtcAo=
133cf4b350e65dad788e46569f52775bc0f89a982db2b409ed994752c8e14be4LS0gMS5qc29uIC92bSxub25lIC1wCg==
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855LS0gMS5qc29uIC92bS9pcC9ub25lIC1wCg==
1e168432cd4bbae3342c6289259f0609a99ced087f122d32ef3427d833d134b1LS0gMS5qc29uIC92bS9pcCxwYXNzd29yZC9ub25lIC1wCg==
9046ecca3ac56c4a36ba56c6dd5a0cb8a7e174c1e27b36d4689395fa5019bc00LS0gMS5qc29uIC92bSxub25lL2lwIC1wCg==
672cb21fcc495919e511dab693bc882b5be777cbe612ca7a52e48abfce91ba36LS0gMi5qc29uIC8gLXAK
5fda8becebe6f8ffa90753b43f8d766567329b4290afd394007db0bd53aa0e3bLS0gMi5qc29uIC9sYWJzIC1wCg==
401c24ebdd73c74eb1b24ba0b9aac6cec011c64a750d75e52b9d9e9edffbbae4LS0gMi5qc29uIC9tZWRpY2F0aW9ucyAtcAo=
9046ecca3ac56c4a36ba56c6dd5a0cb8a7e174c1e27b36d4689395fa5019bc00LS0gMi5qc29uIC9sYWJzLG1lZGljYXRpb25zL25hbWUgLXAK
0947bb4243524a44cc3fd68e2f26f922d4a3957fede19c65a76ebfbe423ad7bdLS0gMi5qc29uIC9tZWRpY2F0aW9ucy9taW5lcmFsIC1wCg==
0947bb4243524a44cc3fd68e2f26f922d4a3957fede19c65a76ebfbe423ad7bdLS0gMi5qc29uIC9tZWRpY2F0aW9ucy9taW5lcmFsLyAtcAo=
672cb21fcc495919e511dab693bc882b5be777cbe612ca7a52e48abfce91ba36LS0gMi5qc29uIC8vLy8vLy8gLXAK
9046ecca3ac56c4a36ba56c6dd5a0cb8a7e174c1e27b36d4689395fa5019bc00LS0gMi5qc29uIC9pbWFnaW5nLGxhYnMvbG9jYXRpb24gLXAK
32b4541ff26d19395e1f5ef44a2ebf9a8e7d087a52740df8d210ef0230ee0028LS0gMy5qc29uIC9wYXlsb2FkL2NvbW1pdHMsaGVhZCxhY3Rpb24gLXAK
eeaedf44f4519df26d6f803c5a47965df1e531ec184befebb84d027eabed7d53LS0gMy5qc29uIC9wYXlsb2FkL2NvbW1pdHMgLXAK
e2fffa47ed1336a5716db92fd4449cc0ced2b4746400e4a4fd1af9d9b944e0cfLS0gMy5qc29uIC9wYXlsb2FkIC1wCg==
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