I am reading multiple json files from source. where column names and column type are varying from file to file.
For example: In one file, column name is coming as an array and in another file it is coming without array. But for my use case I don’t need to worry about the column type.I only want data to be stored.
Now my question is:
I have below two different columns coming from two different file:
Col 1: jsonPath($, “$OT.Refs.TripRef[*][’@BookingRef’]”)
Col 2: OT.Refs.TripRef[’@BookingRef’]
I am reading one by one each file and I want to do following thigs:
- If Col 1 is not coming from file 1 then select Col 2
2- If Col 2 is not coming from file 1 then select Col 1
3- And both should come under one column name
For Example:is not available in the file then select then Column name =