Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the xlsx Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:31:42 2020 GMT+0.
• Introduction | What xlsx is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
;; example: creating a sqlite database from an excel sheet ;; (the contents of the first row are used as column names) (asdf:load-system :sqlite) (asdf:load-system :xlsx) (defun fix-name (str) (loop for char in '(#\- #\/ #\Space) do (setf str (substitute #\_ char str))) (setf str (remove #\. str)) (if (digit-char-p (elt str 0)) (concatenate 'string "_" str) str)) (defun xlsx-to-sqlite (file &optional (na "_NA_")) (let ((xlsx (probe-file file))) (when (null xlsx) (error "~A not found" file)) (let ((sqlite (merge-pathnames (make-pathname :type "sqlite") xlsx))) (when (probe-file sqlite) (error "~A exists already" sqlite)) (let* ((data (xlsx:as-matrix (xlsx:read-sheet file 1) na)) (fields (loop for col from 0 below (array-dimension data 1) collect (fix-name (aref data 0 col)))) (numeric (loop for col from 0 below (array-dimension data 1) collect (every (lambda (x) (or (numberp x) (null x))) (loop for row from 1 below (array-dimension data 0) collect (aref data row col))))) (create-sql (format nil "CREATE TABLE data(~{~A~^,~})" (loop for f in fields for n in numeric collect (if n (format nil "~A NUMBER" f) f)))) (insert-sql (format nil "INSERT INTO data VALUES (~{~A~^,~})" (loop repeat (length fields) collect "?")))) (sqlite:with-open-database (db sqlite) (sqlite:execute-to-list db create-sql) (loop for row from 1 below (array-dimension data 0) do (apply #'sqlite:execute-non-query db insert-sql (loop for col from 0 below (length fields) for item = (aref data row col) collect (if (equal item na) nil item)))))))))
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The xlsx system |
Carlos Ungil <ungil@mac.com>
MIT
Basic reader for Excel files.
xlsx.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The xlsx.asd file | ||
• The xlsx/package.lisp file | ||
• The xlsx/xlsx.lisp file |
Next: The xlsx/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
xlsx.asd
xlsx (system)
Next: The xlsx/xlsx․lisp file, Previous: The xlsx․asd file, Up: Lisp files [Contents][Index]
Previous: The xlsx/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
xlsx (system)
xlsx.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The xlsx package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Creates an array from a list of cells of the form ((:A . 1) . 42)
Empty columns or rows are ignored (column and row names are returned as additional values).
When a value is equal to na-string, nil is returned instead.
Retrieves the id and name of the worksheets in the .xlsx/.xlsm file.
Retrives the contents of the given worksheet as a list of cells of the form ((:A . 1) . 42) A numeric id or name is required unless the file contains a single worksheet.
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L X |
---|
Jump to: | F L X |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | A C E F G L R |
---|
Jump to: | A C E F G L R |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | P S X |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
P | |||
Package, xlsx : | The xlsx package | ||
| |||
S | |||
System, xlsx : | The xlsx system | ||
| |||
X | |||
xlsx : | The xlsx system | ||
xlsx : | The xlsx package | ||
|
Jump to: | P S X |
---|