podhmo / dictknife

armyknife of handling dict object
MIT License
19 stars 4 forks source link

pair view #189

Closed podhmo closed 2 years ago

podhmo commented 2 years ago

before.json with ljust(N, " ") after.json with ljust(N, " ") paste before.json after.json

podhmo commented 2 years ago
$ paste 000person.json 001person.json 
{   {
  "name": "foo",      "name": "bar",
  "age": 20,      "age": 21,
  "type": "person"    "type": "person"
}   }
podhmo commented 2 years ago
$ cat <<-EOS > p.py
import sys

for line in sys.stdin:
    print(line.rstrip().ljust(30, " "))
EOS

$ paste <(cat 000person.json | python p.py) <(cat 001person.json | python p.py)

expected result

{                               {                             
  "name": "foo",                  "name": "bar",              
  "age": 20,                      "age": 21,                  
  "type": "person"                "type": "person"            
}                               }