Skip to main content

All Questions

Tagged with
0 votes
5 answers
160 views

How to add content to a file before the last } character using Busybox utilities?

There is a file with contents { "first_name": "John", "last_name": "Smith", "is_alive": true, "age": 27, "address": { ...
Maxim's user avatar
  • 119
2 votes
2 answers
133 views

How can I select only successful values from leakcheck output?

I have these results that came from leakcheck. How do I properly exclude "false" results and still include the email using bash [email protected] {"success":false,"error":&...
noobwithskillissue's user avatar
2 votes
1 answer
2k views

How to get specific fields of JSON objects for which another field is true

I want to get a specific info from the below command [root@test opc]# /bin/oci compute instance list-vnics --instance-id ocid1.instance.oc1.ap-mumbai-1....
ph3ro's user avatar
  • 378
5 votes
1 answer
120 views

Search, separate, and purge txt values

What's really tripping me about this is the quote marks. I have a file.txt with lines like: {"a":"town, state, country","e":["[email protected]"],"n":&...
horagreensburg's user avatar
-2 votes
5 answers
3k views

How to read list in JSON file using awk and sed

I have a list in JSON file apps.json: { "properites":{ "apps":["apple","orange","mango"] } } I need to read this file and get of objects. I used: ...
Shravya Vaggu's user avatar
0 votes
1 answer
3k views

Find and replace based upon pattern in JSON

Based upon URL I need to find uri like Test123.elb.us-east-1.amazonaws.com and change the connectionId from hkl876 to xed763 For example: locate Test999.elb.us-east-1.amazonaws.com and update ...
crajuc Houston's user avatar
0 votes
5 answers
161 views

How to parse a line which has a number after a certain string greater than a threshold?

I have a file (list_20.txt) that looks like this: [{"d_prime":"0.475425","variation1":"rs909776","r2":"0.057940","variation2":&...
anamaria's user avatar
  • 121
0 votes
2 answers
167 views

How to filter only particular lines from a file?

I have a file which has following lines. I just was to see IP address which is the first line, second line country only once and the score line only once but the score line should be the highest value ...
Ayush Agarwal's user avatar
0 votes
1 answer
6k views

Read a json file and run a command in Bash

I wanna block a mac address which downloaded value is over "20480": The json file: { "client_length": 3, "clients": { "ac:07:5f:77:40:e9": { "id": 1, "ip": "192.168.5.40", ...
Mohi Rostami's user avatar
0 votes
2 answers
978 views

How to extract array from within json to a separate txt file

I have a .json file that I need to extract the SliceTiming field from into a separate txt file. I cannot use jq. If I could, my command would be jq .SliceTiming[] *.json Here is the .json file { "...
Noah's user avatar
  • 9
1 vote
2 answers
562 views

How to parse with Bash script? (platform MIPS)? [duplicate]

$ curl -LNs "http://urladrescom/content.json" > content.json content.json { "k":[ { "i":1, "n":"NAME 1", "p":[ { "b":"Event 1", ...
tioma's user avatar
  • 23
1 vote
1 answer
255 views

extract piece out of JSON line

I've got a number of JSON lines that are pretty long (~1.5KB) and may look something like: "XYZ":{"myString":"myValue",ABCD} and I only want to extract "myString":"myValue" from the whole line. grep ...
stdcerr's user avatar
  • 2,079
3 votes
5 answers
15k views

How to grep/print value of a key in json that is stored in a variable?

I have a variable with nested json, a={"content":[{"JOB_STATUS_ID":283739,"PROGRAM_ID":57,"STATUS":"Completed","**DATA_DATE**":"2017-03-09 00:00:00","**START_TIME**":"2017-03-10 00:46:13","END_TIME":"...
Nick's user avatar
  • 31
1 vote
6 answers
26k views

Grep value from json file

my json file looks something like this [{"product":"Apple","id":"2134"},{"product":"Mango","id":"4567"}] I want to grep/sed/awk 'id' for given 'product'. Output: Enter product : Apple Your product ...
Srikanth Yadake's user avatar