On Wed, Jan 13, 2010 at 11:07 AM, Roger <[email protected]> wrote:
>> Your formatting seems to be off. I had to remove the space between
>> "D:N:-" and ""@lps"" to get it to work - the error messages were
>> incomprehensible, but I think that was the solution:
>>
>>      xmlstarlet sel -T -t -m /mnemosyne/item -s D:N:-"@lps" -v "concat
>> (@lps,'|',Q,'|',A)" -n default.xml
>
> your version of command doesn't work at my site, but good you found a
> working solution for you and maybe others with the same issue.
>
>> (Alas for me, I've never got the hang of the 0/1 rankings and so all
>> my leeches are marked '2', so this script doesn't help me.)
>
> in this case your easyness factor should be a good indicator for the
> leech items... you can change the two @lps in the command to @e and
> change the -s D:N to sort *A*scending by changing to -A:N
> the command should look like this at the end:
> xmlstarlet sel -T -t -m /mnemosyne/item -s D:N:-"@e" -v "concat
> (@e,'|',Q,'|',A)" -n default.xml >> easyness_ranking.txt
>
> in fact, you can sort by any attribute of the item element. a sample
> item element looks like this:
> <item id="9ded5f9b.inv" u="0" gr="4" e="2.462" ac_rp="5" rt_rp="1"
> lps="1" ac_rp_l="2" rt_rp_l="0" l_rp="347" n_rp="349">

After a fair bit of tinkering, and examining the example at the doc,
"xml sel -T -t -m /xml/table/rec -s D:N:- "@id" -v
"concat(@id,'|',numField,'|',stringField)" -n xml/table.xml", I
finally came up with something that works:

[12:31 PM] 160Mb$ xmlstarlet sel  -T -t -m /mnemosyne/item  -s A:N:-
'@e' -v "concat ('Easiness=',@e,'||',Q,'|',A)" -n default.xml

I was a little shocked that 700 of my cards were at 1.300.

-- 
gwern
-- 
You received this message because you are subscribed to the Google Groups 
"mnemosyne-proj-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mnemosyne-proj-users?hl=en.


Reply via email to