392
393
394
395
396
397
398
399
400
401
402
403
404
405
|
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
+
+
+
+
|
;; (let ((dat (read-dat fname)))
;; (if (null? dat)
;; #f
;; (map cadr dat))))))
(define (edit-refdb path)
;; TEMPORARY, REMOVE IN 2014
(if (not (file-exists? path)) ;; Create new
(begin
(print "INFO: Creating new txtdb at " path)
(create-new-db path)))
(if (not (file-exists? (conc path "/sxml/_sheets.sxml")))
(begin
(print "ERROR: You appear to have the old file structure for txtdb. Please do the following and try again.")
(print)
(print "mv " path "/sxml/sheets.sxml " path "/sxml/_sheets.sxml")
(print "mv " path "/sxml/workbook.sxml " path "/sxml/_workbook.sxml")
(print)
|
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
|
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
-
+
-
-
-
-
-
+
-
-
|
(apply process-action (car rema)(cdr rema)))
(else (print help)))))
;;======================================================================
;; C R E A T E N E W D B S
;;======================================================================
(include "txtdb/metadat.scm")
(include "metadat.scm")
;; Creates a new db at path with one sheet
(define (create-new-db path)
(create-directory path #t)
(create-directory (conc path "/sxml") #t))
;; Sheet1.dat
;; sheet-names.cfg
;; sxml/Sheet1.sxml
(extract-refdb minimal-sxml path))
;; sxml/_sheets.sxml
;; sxml/_workbook.sxml
(main)
#|
(define x (refdb:read-gnumeric-xml "testdata-stripped.xml"))
|