I am transforming a large JSON into a fixed-length csv file, at this stage I've cut down the json with a JOLT Remove and I have used a JOLT Shift to put the remaining parameters into the input provided.
I have the output from a previous JOLT 'shift' resembling the following: This will form the input for a JOLT "shift"
{
  "TIME": "2023-02-27T16:26:25Z",
  "FORENM": [
    "JILL",
    "LITA"
  ],
  "SURNAME": [
    "JaCK",
    "HANCOCK"
  ],
  "TOWN": [
    "CHRISTCHURCH",
    "GLASGOW",
    "LAZYTOWN",
    null,
    "TELETUBBYHILL",
    "BALAMORY"
  ]
}
I want the output to resemble the following:
{
  "MAIN-TOWN": "CHRISTCHURCH",
  "MAIN_FORENM": "JILL",
  "MAIN_SURNAME": "JaCK",
  "TIME": "2023-02-27T16:26:25Z",
  "ALT-TOWN": "TELETUBBYHILL",
  "ALT_FORENM": "LITA",
  "ALT_SURNAME": "HANCOCK"
}
Is this possible? If so, can I do it with a shift transform? Could someone show me to I would be able to map a certain index from an array in the input. For example, from the town array I want to map "MAIN-TOWN" to index 0 of the "TOWN" array from the input and index 4 to "ALT-TOWN".
 
     
    