I have a file ~/documents/foo.org
which looks like
#+TBLNAME: data
| | | | p01a | p01b | p02 | p03 |
|------------------+------------------+--------+------+------+-----+-----|
| e-mail | name | total | 5 | 5 | 10 | 25 |
|------------------+------------------+--------+------+------+-----+-----|
| gh01@beatles.edu | Harrison, George | 80.00% | 5 | 4 | 7 | 20 |
| jl01@beatles.edu | Lennon, John | 75.56% | 5 | 3 | 5 | 21 |
| pm01@beatles.edu | McCartney, Paul | 86.67% | 5 | 5 | 6 | 23 |
| rs01@beatles.edu | Starr, Ringo | 82.22% | 5 | 4 | 6 | 22 |
#+TBLFM: @3$3..@>$3=100*vsum($4..$>)/vsum(@2$4..@2$>);%.2f%%
I would like to write a program that takes the information in this table and generates new org
files organizing each person's data separately. For example, the first new file should be ~/documents/individual-reports/harrison-gh01.org
and should look something like
#+Title: George Harrison
#+Email: gh01@beatles.edu
#+Date: <2015-09-12 Sat>
* Exam Results
| | score | possible |
|---------------+-------+----------|
| problem 1 (a) | 5 | 5 |
| problem 1 (b) | 4 | 5 |
| problem 2 | 7 | 10 |
| problem 3 | 20 | 25 |
|---------------+-------+----------|
| total | 36 | 45 |
#+TBLFM: @>$2..@>$>=vsum(@2..@>>)
I imagine this is possible using an elisp snippet but I'm not really sure how to get started. Does anyone know how to start something like this?
Note, I'm not necessarily looking for a full solution. I'm mainly looking for commands to get me started.