I am new here, please be kind. I am trying to import a text file into a HTML nested list. The HTML output I am trying to achieve would look like this:
<ul>
<li>FAVORITE SITES
<ul>
<li>eBay</li>
<li>Google</li>
</ul>
</li>
<li>AVOIDED SITES
<ul>
<li>Yahoo</li>
<li>CraigsList</li>
</ul>
</li>
<li>OTHER SITES
<ul>
<li>Alexa</li>
<li>Amazon</li>
<li>Jet</li>
</ul>
</li>
</ul>
The text file I am loading using <input type="file"> is not formatted in a usual way - it is not JSON or CSV, it is formatted like below:
FAVORITE SITES {
!Variable=eBay
!Variable=Google
}
AVOIDED SITES {
!Variable=Yahoo
!Variable=CraigsList
}
OTHER SITES {
!Variable=Alexa
!Variable=Amazon
!Variable=Jet
}
Is there any way to load parse and input the values of the text file and load them into the list even though the file is in this non-standard format or will I need to change the format of the text file? Any help will be appreciated, thank you.