That's some JSON data that is, with an extra } at the end.
Here's an example of how you can load that JSON data as a Perl data structure, then delete items from it, by name, then re-encode the data structure back into a JSON string. Note it's an array reference of hash references:
use warnings;
use strict;
use JSON;
my $json;
{
local $/;
$json = <DATA>;
}
my $data = decode_json $json;
for my $entry (@$data){
delete $entry->{absoluteLimits};
}
$json = encode_json $data;
print $json;
__DATA__
[{"absoluteLimits":{"conditionalLimits":{"bidirVolume":4096000,"name":
+"Home"},"resetPeriod":{"volume":"monthly day 15 00:??"}},"sliceVolume
+":5120,"subscriptionDate":"29-09-2016"},{"absoluteLimits":{"condition
+alLimits":{"bidirVolume":102400000,"name":"Home"},"resetPeriod":{"vol
+ume":"2400 hours"}},"description":"Promotion_tariffbasic:29-09-2016,0
+8-01-2017T10:21","name":"1004","sliceVolume":5120,"subscriptionDate":
+"30-09-2016T09:21"}]
Output:
[{"subscriptionDate":"29-09-2016","sliceVolume":5120},{"name":"1004","
+subscriptionDate":"30-09-2016T09:21","sliceVolume":5120,"description"
+:"Promotion_tariffbasic:29-09-2016,08-01-2017T10:21"}]
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.