Megatest

Check-in [9cacf1f935]
Login
Overview
Comment:Extracting sheets to txtdb now works
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 9cacf1f935bfd01d98728d6b4bcbf6790f8f8e3e
User & Date: matt on 2013-07-14 02:23:22
Other Links: branch diff | manifest | tags
Context
2013-07-14
03:26
Converted to using xml instead of using sxml in the stored meta files for txtdb check-in: 59fcabaf30 user: matt tags: dev
02:23
Extracting sheets to txtdb now works check-in: 9cacf1f935 user: matt tags: dev
02:19
Extracting sheets to txtdb now works check-in: 81649543cf user: matt tags: dev
Changes

Modified txtdb/txtdb.scm from [8f826c3024] to [8d5711b7f3].

108
109
110
111
112
113
114
115



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
		    (sort (hash-table-keys cols)(lambda (a b)
						  (let ((colnum-a (assoc a ref-colnums))
							(colnum-b (assoc b ref-colnums)))
						    (if (and colnum-a colnum-b)
							(< (cadr colnum-a)(cadr colnum-b))
							(if (and (string? a)
								 (string? b))
							    (string< a b))))))))))))





(define (extract-txtdb dat targdir)
  (let* ((wrkbk   (find-section   dat   'http://www.gnumeric.org/v10.dtd:Workbook))
	 (wrk-rem (remove-section dat   'http://www.gnumeric.org/v10.dtd:Workbook))
	 (sheets  (find-section   wrkbk 'http://www.gnumeric.org/v10.dtd:Sheets))
	 (sht-rem (remove-section wrkbk 'http://www.gnumeric.org/v10.dtd:Sheets)))
    (create-directory targdir)
    (with-output-to-file (conc targdir "/workbook.sxml")
      (lambda ()
	(pp wrk-rem)))
    (with-output-to-file (conc targdir "/sheets.sxml")
      (lambda ()
	(pp sht-rem)))
    (for-each (lambda (sheet)
		(sheet->txtdb sheet targdir))
	      sheets)))

#|  







|
>
>
>







|
|


|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
		    (sort (hash-table-keys cols)(lambda (a b)
						  (let ((colnum-a (assoc a ref-colnums))
							(colnum-b (assoc b ref-colnums)))
						    (if (and colnum-a colnum-b)
							(< (cadr colnum-a)(cadr colnum-b))
							(if (and (string? a)
								 (string? b))
							    (string< a b))))))))))
    (with-output-to-file (conc targdir "/sxml/" sheet-name ".sxml")
      (lambda ()
	(pp remaining)))))


(define (extract-txtdb dat targdir)
  (let* ((wrkbk   (find-section   dat   'http://www.gnumeric.org/v10.dtd:Workbook))
	 (wrk-rem (remove-section dat   'http://www.gnumeric.org/v10.dtd:Workbook))
	 (sheets  (find-section   wrkbk 'http://www.gnumeric.org/v10.dtd:Sheets))
	 (sht-rem (remove-section wrkbk 'http://www.gnumeric.org/v10.dtd:Sheets)))
    (create-directory (conc targdir "/sxml") #t)
    (with-output-to-file (conc targdir "/sxml/workbook.sxml")
      (lambda ()
	(pp wrk-rem)))
    (with-output-to-file (conc targdir "/sxml/sheets.sxml")
      (lambda ()
	(pp sht-rem)))
    (for-each (lambda (sheet)
		(sheet->txtdb sheet targdir))
	      sheets)))

#|