Ankur_kuls has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, I am running a perl script which uses JSON module. Below is script part which is doing the decoding
my $data = decode_json $line;Now while running this script I am getting the below error
File2: VSCDR_0001_00150_20150721-102225.json ':' expected, at character offset 193 (before "@serialNumber":"4000... +") at /root/reportscr/scripts/vs_state_change_dr_UW.pl line 103
Now as the error suggested line 193 of json file VSCDR_0001_00150_20150721-102225.json contains the error. Below are part of json file from line no. 191 to 195. (middle record is record no- 193).
{"@serialNumber":"235665321979", "@timestamp":"20150721T10:22:59+0530" +, "@subscriberId":"7409808075", "@transactionId":"394345856161456", " +@operatorId":"", "@voucherGroup":"B9", "@expiryDate":"20160731T23:59: +59+0530", "@state":"RESERVED", "@reserveTimeoutResolution":"PENDING", + "@subState":"", "@serviceType":"RESERVE_RECORD", "@value":"1554", "@ +agent":"", "@batchId":"10003"} {"@serialNumber":"235665321979", "@timestamp":"20150721T10:22:59+0530" +, "@subscriberId":"7409808075", "@transactionId":"394345856161456", " +@operatorId":"", "@voucherGroup":"B9", "@expiryDate":"20160731T23:59: +59+0530", "@state":"USED", "@reserveTimeoutResolution":"", "@subState +":"", "@serviceType":"COMMIT_RECORD", "@value":"1554", "@agent":"", " +@batchId":"10003"} {"@serialNumber":"400003262400", "@timestamp":"20150721T10:22:59+0530" +, "@subscriberId":"9675312531", "@transactionId":"442230856161952", " +@operatorId":"", "@voucherGroup":"A9", "@expiryDate":"20160817T23:59: +59+0530", "@state":"RESERVED", "@reserveTimeoutResolution":"PENDING", + "@subState":"", "@serviceType":"RESERVE_RECORD", "@value":"777", "@a +gent":"", "@batchId":"RC_10"} {"@serialNumber":"400003262400", "@timestamp":"20150721T10:22:59+0530" +, "@subscriberId":"9675312531", "@transactionId":"442230856161952", " +@operatorId":"", "@voucherGroup":"A9", "@expiryDate":"20160817T23:59: +59+0530", "@state":"USED", "@reserveTimeoutResolution":"", "@subState +":"", "@serviceType":"COMMIT_RECORD", "@value":"777", "@agent":"", "@ +batchId":"RC_10"} {"@serialNumber":"235666366547", "@timestamp":"20150721T10:22:59+0530" +, "@subscriberId":"9759261690", "@transactionId":"732696256161800", " +@operatorId":"", "@voucherGroup":"B9", "@expiryDate":"20160731T23:59: +59+0530", "@state":"RESERVED", "@reserveTimeoutResolution":"PENDING", + "@subState":"", "@serviceType":"RESERVE_RECORD", "@value":"1554", "@ +agent":"", "@batchId":"10002"}
This looks like in proper format. I am not able to figure out the problem. Could you please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl script not working with JSON module
by GotToBTru (Prior) on Jul 23, 2015 at 12:53 UTC | |
by Anonymous Monk on Jul 23, 2015 at 13:56 UTC | |
|
Re: Perl script not working with JSON module
by roboticus (Chancellor) on Jul 23, 2015 at 13:45 UTC | |
by Anonymous Monk on Jul 24, 2015 at 09:51 UTC |