Elisp snippet for sucking data into BBDB

| emacs
(defun sacha/suck-data-into-bbdb (notes)
  "Create BBDB data given NOTES.
The region should contain data of the form:
name | company | e-mail"
  (interactive "MEnter notes string: ")
  (while (re-search-forward "^\\(.*?\\)\s*|\s*\\(.*?\\)\s*|\s*\\(.*?\\)\s*$" nil t)
    (let* ((name (match-string 1))
           (company (match-string 2))
           (net (match-string 3))
           (record (bbdb-search-simple nil net)))
      (if record
          (bbdb-record-set-notes record (concat (bbdb-record-notes record) "\n" notes))
        (bbdb-create-internal name company net nil nil notes)))))
You can comment with Disqus or you can e-mail me at sacha@sachachua.com.