Menu

Mass adding of labels?

Bryce
2020-02-04
2020-02-06
  • Bryce

    Bryce - 2020-02-04

    Hi again Jason, still loving the software. Although I still haven't added nearly everything I'd like to have in there, the stuff I have added is much more organized and useable than any other system I've used before.

    Question for you: I followed your advice from a previous thread and created a Term record for "fMRI," and have added a bit of material to that. But I've found that I still need a work record label "fmri" because some papers involve fMRI but wouldn't really be considered "Key Works" to get listed on the Term record.

    So now I find myself adding many of these work labels in order to categorize different papers I've read. So my question is, is there any way to add a huge list of work record labels all at once, like by importing a text file with one record label per line? Right now my process is to open up a word record, click the "..." in the "labels" section, and then right-click the "all labels" line in order to add a new one. Is there a faster way to do this, or a way that I can add many at once?

     
  • Jason Winning

    Jason Winning - 2020-02-06

    Hi Bryce,

    There is no way to do this in the user interface, but you could do it by directly editing the Works.xml file. To do this, first exit out of Hypernomicon. Open the Works.xml file (in the XML database folder) in a text editor like Notepad (Windows) or TextEdit (Mac). After the line that begins "<records" (note the S) and before the first line that begins with "<record" (no S), you can insert the XML for the records you want to create. Suppose you want to create three labels, for Cerebellum, Neocortex, and Midbrain. Then you could add these lines:

    <record type="work_label"><text>Cerebellum</text></record>
    <record type="work_label"><text>Neocortex</text></record>
    <record type="work_label"><text>Midbrain</text></record>

    You can add however many label records you want, as long as the same string of characters appears before and after the label name as in the above lines.

    If you have a very large list of labels you want to create (so that copying and pasting the text before and after the label name would be very time consuming and haphazard), you could use a text editor with more features like Notepad++ or jEdit to convert a text file with one label name per line to the format above, for example by replacing each new line character with this text:

    <record type="work_label"><text></text></record>

    and editing the beginning (by removing the first "") and end (by removing the final "<record type="work_label"><text>").</text></record>

    Best,
    Jason

     
  • Bryce

    Bryce - 2020-02-06

    Perfect!!! This is just what I was hoping for. Thanks a lot!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.