Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is my second attempt. I wrote a little macro and some functions to deal with such data.</p> <pre> (defun better-numberp (s) (string-match "^ *[0-9.,]* *$" s)) (defmacro awk-like (&rest args) (let ((arg (car (last args))) (calls (mapcar #'(lambda (l) (cond ((numberp (first l)) (cons `(lambda (f) (equal %r ,(first l))) (rest l))) ((stringp (first l)) (cons `(lambda (f) (string-match ,(first l) %)) (rest l))) (t l))) (butlast args)))) `(mapcar #'(lambda (%%) (let ((%r 0)) (mapcar #'(lambda (l) (setq %r (1+ %r)) (let ((% l)) (dolist (tipo ',calls) (progn (setq % (cond ((funcall (first tipo) %) (eval (cadr tipo))) (t %))) (set (intern (format "%%%d" %r)) %))) %)) %%))) (mapcar #'(lambda (y) (split-string y " " t)) (split-string ,arg "\n" t))))) (defun hash-to-list (hashtable) "Return a list that represent the hashtable." (let (mylist) (maphash (lambda (kk vv) (setq mylist (cons (list kk vv) mylist))) hashtable) mylist ) ) (defun append-hash (key value hashtable) (let ((current (gethash key hashtable))) (puthash key (cond ((null current) (list value)) ((listp current) (cons value current)) (t current)) hashtable))) </pre> <pre> (let ((foohash (make-hash-table :test 'equal))) (awk-like (2 (replace-regexp-in-string ":" "" %)) ((lambda (f) (> %r 2)) (append-hash % %2 foohash)) "** Diego: b QI ** bruno-gil: b QI ** Koma: jo ** um: rsrs pr0n ** FelipeAugusto: esp ** GustavoPupo: pinto tr etc ** GP: lit gtk ** Alan: jo mil pc ** Jost: b hq jo 1997 ** Herbert: b rsrs pr0n ** Andre: maia mil pseudo ** Rodrigo: c ** caue: b rsrs 7arte pseudo ** kenny: cri gif ** daniel: gtk mu pr0n rsrs b ** tony: an 1997 esp ** Vitor: b jo mimimi ** raphael: b rpg 7arte ** Luca: b lit gnu pc prog mmu 7arte 1997 ** LZZ: an qt ** William: b an jo pc 1997 ** Epic: gtk ** Aldo: b pseudo pol mil fur ** GustavoKyon: an gtk ** CarlosIsaksen: an hq jo 7arte gtk 1997 ** Peter: pseudo pol mil est 1997 gtk lit lang ** leandro: b jo cb ** frederico: 7arte lit gtk ** rol: b an pseudo mimimi 7arte ** mathias: jo lit ** henrique: 1997 h gtk qt ** eumané: an qt ** walrus: cri de ** FilipePinheiro: lit pseudo ** Igor: pseudo b ** Erick: b jo rpg q 1997 gtk ** Gabriel: pr0n rsrs qt ** george: clo mimimi ** anão: hq jo 1997 rsrs clô b ** jeff: 7arte gtk ** davidatenas: an 7arte 1997 esp qt ** HHahaah: b ** Eduardo: b ") (hash-to-list foohash)) </pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload