J
J
john_connor_jr2019-03-17 02:09:10
bash
john_connor_jr, 2019-03-17 02:09:10

How to cut a substring from a string using sed | awk?

I ask for help from connoisseurs of regular expressions. Four hours of googling left me exactly where I was before.
There is a long string received from curl, I need this part of it:
...,"load":{"map":["load_id","add_time","marks","available","external"]," data":[["77458","1552767081","11.57","298","0"],...
I want to create a load_id variable and give it the value 77458, and
I want to create an add_time variable and give it the value 1552767081
these I need variables for further substitution in curl and sending requests.
All this economy is spinning in Cygwin - mintty, i.e. thought to use sed or awk, but did not master (

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
DevMan, 2019-03-17
@john_connor_jr

why is everyone trying to use regexps where it's not needed ...
put yourself https://stedolan.github.io/jq/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question