We are getting JSON data using curl
and data is getting appended to the same file by calling endpoint URL using curl
in a loop.
Due to this, header of JSON output is being repetitive in same file. so I want to remove multiple headers from file except the first one using shell.
str1="]}}{"QueryResult": {"APIMajor": "2", "APIMinor": "0", "Errors": [], "Warnings": [], "TotalResultCount": 272, "StartInd": 201, "PageSize": 200, "Results": ["
str2=", "
How do I replace str1
in a JSON file with str2
using shell?