Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a literature student and I'd like to be able to annotate literary texts (originally stored in HTML or as text files) on a word-by-word or line-by-line basis. I hear databases like mySQL or SQLite would be good ways to do this sort of thing, but I don't really know where to start.

I'm comfortable with the linux command-line, and have done some HTML/CSS work in the past, so I feel unintimidated by databases and things...I just don't know what to start doing.

share|improve this question
Consider a personal wiki instead of a database (which might be overkill for your needs). – Renan Jul 12 '12 at 20:02

There are a lot of MySQL tutorials on the web, e.g. this one.

Once you learn the basics of SQL, if you want to make a database for annotating lines, you could read each line of a text file separately into a table called LINES_OF_TEXT using the LOAD DATA INFILE command in MySQL. You can then have another table called ANNOTATIONS that refers to entries in the LINES_OF_TEXT table; that way you can have multiple annotations for each line of text. E.g.:

ID    | line
1     | This is a line, 
2     | and another one follows.

lines_of_text_ID | annotation
1                | has a comma
1                | starts with a capital letter
2                | ends with a period
2                | dependent clause
1                | passive voice

You can relate the tables to each other using JOIN queries.

share|improve this answer

I'm not sure a SQL database is your best solution here. They're not really meant as end-user tools more as back-end storage for applications.

You might be better off with just a spreadsheet ... OR ... why not come up with your own annotation scheme, e.g. <!-- MYNOTE: This is a note !-->, and add it to the file directly. Then using an indexed search program (e.g. lucene) you'd be able to find your annotations quickly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.