Hi.
I am trying to modify the input data structure of json data.
Current structure:
{"OWNER":"KeyProjects","Region":"Southern","District":"Arid","PLANTNO" +:"Sunset View","COMPT":"A08","age1":null,"ht1":null,"age2":null,"ht2" +:null,"age3":null,"ht3":null,"age4":null,"ht4":null,"age5":null,"ht5" +:null,"age6":null,"ht6":null,"age1":null,"ht1":null,"age2":null,"ht2" +:null,"age3":null,"ht3":null,"age4":null,"ht4":null,"age5":null,"ht5" +:null,"age6":null,"ht6":null,"wc":"EF1"},
I want it to look like this:
{"OWNER":"KeyProjects","Region":"Southern","District":"Arid","PLANTNO" +:"Sunset View","COMPT":"A08","scheduled":{"age1":null,"ht1":null,"age +2":null,"ht2":null,"age3":null,"ht3":null,"age4":null,"ht4":null,"age +5":null,"ht5":null,"age6":null,"ht6":null},"completed":{"age1":null," +ht1":null,"age2":null,"ht2":null,"age3":null,"ht3":null,"age4":null," +ht4":null,"age5":null,"ht5":null,"age6":null,"ht6":null},"wc":"EF1"}
(two sections are now nested(extra{}s), with the words "scheduled" and "completed" added).
The fields of the original data vary in length so simply counting characters to find an insert point will not help.
Just can't get perl regex to do what I want it to do.
Assistance would be greatly appreciated
John
In reply to Find a Position and Insert Text by jlb333333
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |