0

Here is my input json data file

{"uq_id" : "12rtyADF",
 "item_ids": {"item_id" : "123",
              "item_name" : "telephone"},
 "path" : ["1|2|6|3"],
 "time" : "20150818150000" }

{"uq_id" : "1234yADF",
 "item_ids" : {},
 "time" : "20150818150000"}
{"uq_id" : "1er45ADF",
 "item_ids" : {},
 "path" : ["1|2|6|3"] }

I would like to convert this to csv or txt format as below:

----------------------------------------------------------------------------
   uq_id  | item_ids_itemid | item_ids_itemname | path      | time
----------------------------------------------------------------------------
 12rtyADF | 123             | telephone         | "1|2|6|3" | 20150818150000
 1234yADF |                 |                   |           | 20150818150000
 1er45ADF |                 |                   | "1|2|6|3" |

Please note that all field in the input file are not mandatory except uq_id.

request is to read the json file and load to oracle DB. Was thinking if json file can be converted to csv or text then its easy to load to oracle DB. Oracle version is 11g.

diziaq
  • 6,881
  • 16
  • 54
  • 96
Naveen
  • 1
  • 1
    Can you post what you have tried so far? – nonamorando Aug 18 '15 at 19:41
  • 2
    Why not pull the JSON into Python, deserialize it there, then have Python update Oracle? That way you don't mess with a CSV. Here's how to use JSON in Python http://stackoverflow.com/questions/2835559/parsing-values-from-a-json-file-in-python, and how to have Python access Oracle: http://stackoverflow.com/questions/3521692/how-can-i-access-oracle-from-python – Jonathan M Aug 18 '15 at 19:43

0 Answers0