Skip to main content
1 of 3
Silver
  • 61
  • 1
  • 1
  • 2

patch or code to convert text in txt file

I have 5000 questions in txt file like this:

<quiz>
        <que>The question her</que>
        <ca>text</ca>
        <ia>text</ia>
        <ia>text</ia>
        <ia>text</ia>
    </quiz>

I want patch in ubuntu to convert all questions like this:

  {
   "text":"The question her",
   "answer1":"text",
   "answer2":"text",
   "answer3":"text",
   "answer4":"text"
  },

Regards

Silver
  • 61
  • 1
  • 1
  • 2