Remove first meta key from json records using shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Remove first meta key from json records using shell
# 8  
Old 01-18-2019
I'm the same opinion as Andrew(apmd47). jq is the greatest command line tool for JSON-parsing and manipulation I know. It has a ton of possibilites to mangle / extract json data in this very small binary(<30K). It's written in portable c, with no runtime dependencies. See: jq

Last edited by stomp; 01-18-2019 at 06:22 AM..
These 2 Users Gave Thanks to stomp For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to convert any shell command output to JSON format?

Hi All, I am new to shell scripting, Need your help in creating a shell script which converts any unix command output to JSON format output. example: sample df -h command ouput : Filesystem size used avail capacity Mounted /dev/dsk/c1t0d0s0 8.1G 4.0G 4.0G 50% /... (13 Replies)
Discussion started by: balu1234
13 Replies

2. Shell Programming and Scripting

Remove lines from multiline json

Hi , When extracting the data from API end point ,its giving multi line json .I want to remove certain lines with group": "tag" or tget and respect "item" values python test.py /data{" Id":" 7554317""group":"get", "item":"xx5e1"],"fields":} { "time": 1520460953, "... (4 Replies)
Discussion started by: akil
4 Replies

3. UNIX for Beginners Questions & Answers

Json field grap via shell script/awk

i have a json data that looks like this: { "ip": "16.66.35.10", "hostname": "No Hostname", "city": "Stepney", "region": "England", "country": "GB", "loc": "51.57,-0.0333", "org": "AS6871 British Telecommunications PLC", "postal": "E1" } im looking for a way to assign... (9 Replies)
Discussion started by: SkySmart
9 Replies

4. Shell Programming and Scripting

Passing key column from parent to child records

Hi Forum. I have this challenging issue that I'm hoping someone can help me. I have a file that contains 3 different types of segments (AM00, AM01, AM32) in a hierarchy structure and I want to be able to pass the column key from the parent record to the children records. AM00 - parent key:... (13 Replies)
Discussion started by: pchang
13 Replies

5. Shell Programming and Scripting

Removing specific records from files when duplicate key

Hello I have been trying to remove a row from a file which has the same first three columns as another row - I have tried lots of different combinations of suggestion on this forum but can't get it exactly right. what I have is 900 - 1000 = 0 900 - 1000 = 2562 1000 - 1100 = 0 1000 - 1100... (7 Replies)
Discussion started by: tinytimmay
7 Replies

6. UNIX for Advanced & Expert Users

howto remove meta info about MP4 or FLV file downloaded off Youtube?

Hi I tried a tool called mediainfo > brew info media-info media-info 0.7.51 http://mediainfo.sourceforge.net Depends on: pkg-config /usr/local/Cellar/media-info/0.7.51 (3 files, 14M) http://github.com/mxcl/homebrew/commits/master/Library/Formula/media-info.rb Got details from a test... (3 Replies)
Discussion started by: slashdotweenie
3 Replies

7. Shell Programming and Scripting

awk - splitting 1 large file into multiple based on same key records

Hello gurus, I am new to "awk" and trying to break a large file having 4 million records into several output files each having half million but at the same time I want to keep the similar key records in the same output file, not to exist accross the files. e.g. my data is like: Row_Num,... (6 Replies)
Discussion started by: kam66
6 Replies

8. Shell Programming and Scripting

How can i use shell meta characters like * ,$ <,> ?

hey guys!! please tell me ...how can i use shell meta characters like * ,$ <,> etc in command line in command line arguments literally please reply soon ..its urgent!!!! (8 Replies)
Discussion started by: tprayush
8 Replies

9. Shell Programming and Scripting

How to delete duplicate records based on key

For example suppose I have a file which contains data as: $cat data 800,2 100,9 700,3 100,9 200,8 100,3 Now I want the output as 200,8 700,3 800,2 Key is first three characters, I don't want any reords which are having duplicate keys. Like sort +0.0 -0.3 data can we use... (9 Replies)
Discussion started by: sumitc
9 Replies

10. UNIX for Dummies Questions & Answers

Generating key values for leader records

All, I have a file with text as shown below. I want the o/p file with generated values in the first column as shown in the o/p file. Pls note that the size of my file is 6 GB. How do i do this ? Input file 999999abcdef 999999ghijkl 999999mnopq 777777rosesarered 777777skyisblue Output... (1 Reply)
Discussion started by: ajfaq
1 Replies
Login or Register to Ask a Question
JSON_XS(1p)						User Contributed Perl Documentation					       JSON_XS(1p)

NAME
json_xs - JSON::XS commandline utility SYNOPSIS
json_xs [-v] [-f inputformat] [-t outputformat] DESCRIPTION
json_xs converts between some input and output formats (one of them is JSON). The default input format is "json" and the default output format is "json-pretty". OPTIONS
-v Be slightly more verbose. -f fromformat Read a file in the given format from STDIN. "fromformat" can be one of: json - a json text encoded, either utf-8, utf16-be/le, utf32-be/le storable - a Storable frozen value storable-file - a Storable file (Storable has two incompatible formats) clzf - Compress::LZF format (requires that module to be installed) yaml - YAML (avoid at all costs, requires the YAML module :) eval - evaluate the given code as (non-utf-8) Perl, basically the reverse of "-t dump" -t toformat Write the file in the given format to STDOUT. "toformat" can be one of: json, json-utf-8 - json, utf-8 encoded json-pretty - as above, but pretty-printed json-utf-16le, json-utf-16be - little endian/big endian utf-16 json-utf-32le, json-utf-32be - little endian/big endian utf-32 storable - a Storable frozen value in network format storable-file - a Storable file in network format (Storable has two incompatible formats) clzf - Compress::LZF format yaml - YAML dump - Data::Dump dumper - Data::Dumper Note that Data::Dumper doesn't handle self-referential data structures correctly - use "dump" instead. EXAMPLES
json_xs -t null <isitreally.json "JSON Lint" - tries to parse the file isitreally.json as JSON - if it is valid JSON, the command outputs nothing, otherwise it will print an error message and exit with non-zero exit status. <src.json json_xs >pretty.json Prettify the JSON file src.json to dst.json. json_xs -f storable-file <file Read the serialised Storable file file and print a human-readable JSON version of it to STDOUT. json_xs -f storable-file -t yaml <file Same as above, but write YAML instead (not using JSON at all :) lwp-request http://cpantesters.perl.org/show/JSON-XS.json | json_xs Fetch the cpan-testers result summary "JSON::XS" and pretty-print it. AUTHOR
Copyright (C) 2008 Marc Lehmann <json@schmorp.de> perl v5.14.2 2010-08-17 JSON_XS(1p)