Skip to main content
added 8 characters in body; edited tags; edited title
Source Link
Stéphane Chazelas
  • 584.7k
  • 96
  • 1.1k
  • 1.7k

patch or code script to convert text in txt filetranslate xml to json

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 patchto write a script in ubuntuUbuntu to convert all questions like this:

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

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"
  },

script to translate xml to json

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 to write a script in Ubuntu to convert all questions like this:

  {
   "text":"The question her",
   "answer1":"text",
   "answer2":"text",
   "answer3":"text",
   "answer4":"text"
  },
deleted 7 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 237

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

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

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"
  },
Source Link
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