Index: txtdb/nada3/Second-sheet.dat ================================================================== --- txtdb/nada3/Second-sheet.dat +++ txtdb/nada3/Second-sheet.dat @@ -7,11 +7,11 @@ V17 + [A1] V8 Z V17 = -# + # Just a test really # V1 X V3 X V5 Y @@ -19,18 +19,16 @@ V10 Z V11 E V13 E V14 B V16 B - [3] V2 John, V6 Tom V8 Fred V17 ~ -# + # a deeply held belief is a danger to sanity # V4 X row-11 Z row-18 B - Index: txtdb/nada3/sxml/First_Sheet.sxml ================================================================== --- txtdb/nada3/sxml/First_Sheet.sxml +++ txtdb/nada3/sxml/First_Sheet.sxml @@ -8,11 +8,11 @@ (HideColHeader "0") (GridColor "0:0:0") (DisplayOutlines "1") (DisplayFormulas "0")) (http://www.gnumeric.org/v10.dtd:MaxCol "8") - (http://www.gnumeric.org/v10.dtd:MaxRow "17") + (http://www.gnumeric.org/v10.dtd:MaxRow "18") (http://www.gnumeric.org/v10.dtd:Zoom "1") (http://www.gnumeric.org/v10.dtd:Names (http://www.gnumeric.org/v10.dtd:Name (http://www.gnumeric.org/v10.dtd:name "Print_Area") (http://www.gnumeric.org/v10.dtd:value "#REF!") @@ -303,11 +303,12 @@ (@ (Unit "64.01") (No "2") (Count "7")))) (http://www.gnumeric.org/v10.dtd:Rows (@ (DefaultSizePts "12.1")) (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "12.64") (No "0"))) (http://www.gnumeric.org/v10.dtd:RowInfo - (@ (Unit "13.5") (No "1") (Count "17")))) + (@ (Unit "13.5") (No "1") (Count "17"))) + (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "12.1") (No "18")))) (http://www.gnumeric.org/v10.dtd:Selections (@ (CursorRow "3") (CursorCol "1")) (http://www.gnumeric.org/v10.dtd:Selection (@ (startRow "3") (startCol "1") (endRow "3") (endCol "1")))) (http://www.gnumeric.org/v10.dtd:SheetLayout Index: txtdb/nada3/sxml/RunsToDo.sxml ================================================================== --- txtdb/nada3/sxml/RunsToDo.sxml +++ txtdb/nada3/sxml/RunsToDo.sxml @@ -8,11 +8,11 @@ (HideColHeader "0") (GridColor "0:0:0") (DisplayOutlines "1") (DisplayFormulas "0")) (http://www.gnumeric.org/v10.dtd:MaxCol "3") - (http://www.gnumeric.org/v10.dtd:MaxRow "3") + (http://www.gnumeric.org/v10.dtd:MaxRow "4") (http://www.gnumeric.org/v10.dtd:Zoom "1") (http://www.gnumeric.org/v10.dtd:Names (http://www.gnumeric.org/v10.dtd:Name (http://www.gnumeric.org/v10.dtd:name "Print_Area") (http://www.gnumeric.org/v10.dtd:value "#REF!") @@ -82,11 +82,12 @@ (http://www.gnumeric.org/v10.dtd:ColInfo (@ (Unit "48") (No "0") (Count "4")))) (http://www.gnumeric.org/v10.dtd:Rows (@ (DefaultSizePts "12.75")) (http://www.gnumeric.org/v10.dtd:RowInfo - (@ (Unit "13.5") (No "0") (Count "4")))) + (@ (Unit "13.5") (No "0") (Count "4"))) + (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "12.75") (No "4")))) (http://www.gnumeric.org/v10.dtd:Selections (@ (CursorRow "3") (CursorCol "2")) (http://www.gnumeric.org/v10.dtd:Selection (@ (startRow "3") (startCol "2") (endRow "3") (endCol "2")))) (http://www.gnumeric.org/v10.dtd:SheetLayout (@ (TopLeft "A1"))) Index: txtdb/nada3/sxml/Second-sheet.sxml ================================================================== --- txtdb/nada3/sxml/Second-sheet.sxml +++ txtdb/nada3/sxml/Second-sheet.sxml @@ -8,11 +8,11 @@ (HideColHeader "0") (GridColor "0:0:0") (DisplayOutlines "1") (DisplayFormulas "0")) (http://www.gnumeric.org/v10.dtd:MaxCol "3") - (http://www.gnumeric.org/v10.dtd:MaxRow "21") + (http://www.gnumeric.org/v10.dtd:MaxRow "24") (http://www.gnumeric.org/v10.dtd:Zoom "1") (http://www.gnumeric.org/v10.dtd:Names (http://www.gnumeric.org/v10.dtd:Name (http://www.gnumeric.org/v10.dtd:name "Print_Area") (http://www.gnumeric.org/v10.dtd:value "#REF!") @@ -53,35 +53,11 @@ (http://www.gnumeric.org/v10.dtd:paper "na_letter") (http://www.gnumeric.org/v10.dtd:comments "in_place") (http://www.gnumeric.org/v10.dtd:errors "as_displayed")) (http://www.gnumeric.org/v10.dtd:Styles (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "0") (startCol "0") (endRow "15") (endCol "7")) - (http://www.gnumeric.org/v10.dtd:Style - (@ (WrapText "0") - (VAlign "2") - (ShrinkToFit "0") - (Shade "0") - (Rotation "0") - (PatternColor "0:0:0") - (Locked "1") - (Indent "0") - (Hidden "0") - (HAlign "1") - (Format "General") - (Fore "0:0:0") - (Back "FFFF:FFFF:FFFF")) - (http://www.gnumeric.org/v10.dtd:Font - (@ (Unit "10") - (Underline "0") - (StrikeThrough "0") - (Script "0") - (Italic "0") - (Bold "0")) - "Sans"))) - (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "16") (startCol "0") (endRow "31") (endCol "2")) + (@ (startRow "0") (startCol "0") (endRow "31") (endCol "2")) (http://www.gnumeric.org/v10.dtd:Style (@ (WrapText "0") (VAlign "2") (ShrinkToFit "0") (Shade "0") @@ -125,11 +101,59 @@ (Script "0") (Italic "0") (Bold "0")) "Sans"))) (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "256") (startCol "0") (endRow "65535") (endCol "63")) + (@ (startRow "256") (startCol "0") (endRow "65279") (endCol "255")) + (http://www.gnumeric.org/v10.dtd:Style + (@ (WrapText "0") + (VAlign "2") + (ShrinkToFit "0") + (Shade "0") + (Rotation "0") + (PatternColor "0:0:0") + (Locked "1") + (Indent "0") + (Hidden "0") + (HAlign "1") + (Format "General") + (Fore "0:0:0") + (Back "FFFF:FFFF:FFFF")) + (http://www.gnumeric.org/v10.dtd:Font + (@ (Unit "10") + (Underline "0") + (StrikeThrough "0") + (Script "0") + (Italic "0") + (Bold "0")) + "Sans"))) + (http://www.gnumeric.org/v10.dtd:StyleRegion + (@ (startRow "65280") (startCol "0") (endRow "65532") (endCol "255")) + (http://www.gnumeric.org/v10.dtd:Style + (@ (WrapText "0") + (VAlign "2") + (ShrinkToFit "0") + (Shade "0") + (Rotation "0") + (PatternColor "0:0:0") + (Locked "1") + (Indent "0") + (Hidden "0") + (HAlign "1") + (Format "General") + (Fore "0:0:0") + (Back "FFFF:FFFF:FFFF")) + (http://www.gnumeric.org/v10.dtd:Font + (@ (Unit "10") + (Underline "0") + (StrikeThrough "0") + (Script "0") + (Italic "0") + (Bold "0")) + "Sans"))) + (http://www.gnumeric.org/v10.dtd:StyleRegion + (@ (startRow "65533") (startCol "0") (endRow "65535") (endCol "255")) (http://www.gnumeric.org/v10.dtd:Style (@ (WrapText "0") (VAlign "2") (ShrinkToFit "0") (Shade "0") @@ -149,11 +173,35 @@ (Script "0") (Italic "0") (Bold "0")) "Sans"))) (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "16") (startCol "3") (endRow "18") (endCol "3")) + (@ (startRow "0") (startCol "3") (endRow "0") (endCol "3")) + (http://www.gnumeric.org/v10.dtd:Style + (@ (WrapText "0") + (VAlign "2") + (ShrinkToFit "0") + (Shade "0") + (Rotation "0") + (PatternColor "0:0:0") + (Locked "1") + (Indent "0") + (Hidden "0") + (HAlign "1") + (Format "General") + (Fore "0:0:0") + (Back "FFFF:FFFF:FFFF")) + (http://www.gnumeric.org/v10.dtd:Font + (@ (Unit "28") + (Underline "0") + (StrikeThrough "0") + (Script "0") + (Italic "0") + (Bold "0")) + "Sans"))) + (http://www.gnumeric.org/v10.dtd:StyleRegion + (@ (startRow "1") (startCol "3") (endRow "15") (endCol "3")) (http://www.gnumeric.org/v10.dtd:Style (@ (WrapText "0") (VAlign "2") (ShrinkToFit "0") (Shade "0") @@ -173,11 +221,11 @@ (Script "0") (Italic "0") (Bold "0")) "Sans"))) (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "19") (startCol "3") (endRow "19") (endCol "3")) + (@ (startRow "16") (startCol "3") (endRow "16") (endCol "3")) (http://www.gnumeric.org/v10.dtd:Style (@ (WrapText "0") (VAlign "2") (ShrinkToFit "0") (Shade "1") @@ -197,11 +245,11 @@ (Script "0") (Italic "0") (Bold "0")) "Sans"))) (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "20") (startCol "3") (endRow "31") (endCol "3")) + (@ (startRow "17") (startCol "3") (endRow "31") (endCol "3")) (http://www.gnumeric.org/v10.dtd:Style (@ (WrapText "0") (VAlign "2") (ShrinkToFit "0") (Shade "0") @@ -221,11 +269,11 @@ (Script "0") (Italic "0") (Bold "0")) "Sans"))) (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "16") (startCol "4") (endRow "31") (endCol "7")) + (@ (startRow "0") (startCol "4") (endRow "31") (endCol "7")) (http://www.gnumeric.org/v10.dtd:Style (@ (WrapText "0") (VAlign "2") (ShrinkToFit "0") (Shade "0") @@ -245,35 +293,11 @@ (Script "0") (Italic "0") (Bold "0")) "Sans"))) (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "0") (startCol "8") (endRow "255") (endCol "63")) - (http://www.gnumeric.org/v10.dtd:Style - (@ (WrapText "0") - (VAlign "2") - (ShrinkToFit "0") - (Shade "0") - (Rotation "0") - (PatternColor "0:0:0") - (Locked "1") - (Indent "0") - (Hidden "0") - (HAlign "1") - (Format "General") - (Fore "0:0:0") - (Back "FFFF:FFFF:FFFF")) - (http://www.gnumeric.org/v10.dtd:Font - (@ (Unit "10") - (Underline "0") - (StrikeThrough "0") - (Script "0") - (Italic "0") - (Bold "0")) - "Sans"))) - (http://www.gnumeric.org/v10.dtd:StyleRegion - (@ (startRow "0") (startCol "64") (endRow "65535") (endCol "255")) + (@ (startRow "0") (startCol "8") (endRow "255") (endCol "255")) (http://www.gnumeric.org/v10.dtd:Style (@ (WrapText "0") (VAlign "2") (ShrinkToFit "0") (Shade "0") @@ -303,16 +327,19 @@ (http://www.gnumeric.org/v10.dtd:ColInfo (@ (Unit "227.2") (No "3") (HardSize "1")))) (http://www.gnumeric.org/v10.dtd:Rows (@ (DefaultSizePts "12.1")) (http://www.gnumeric.org/v10.dtd:RowInfo - (@ (Unit "13.5") (No "0") (Count "21"))) - (http://www.gnumeric.org/v10.dtd:RowInfo (@ (Unit "12.1") (No "21")))) + (@ (Unit "60") (No "0") (HardSize "1"))) + (http://www.gnumeric.org/v10.dtd:RowInfo + (@ (Unit "13.5") (No "1") (Count "17"))) + (http://www.gnumeric.org/v10.dtd:RowInfo + (@ (Unit "12.1") (No "18") (Count "4")))) (http://www.gnumeric.org/v10.dtd:Selections - (@ (CursorRow "11") (CursorCol "3")) + (@ (CursorRow "0") (CursorCol "3")) (http://www.gnumeric.org/v10.dtd:Selection - (@ (startRow "11") (startCol "3") (endRow "11") (endCol "3")))) + (@ (startRow "0") (startCol "3") (endRow "0") (endCol "3")))) (http://www.gnumeric.org/v10.dtd:SheetLayout (@ (TopLeft "A1"))) (http://www.gnumeric.org/v10.dtd:Solver (@ (ProgramR "0") (ProblemType "0") (NonNeg "1") Index: txtdb/nada3/sxml/sheets.sxml ================================================================== --- txtdb/nada3/sxml/sheets.sxml +++ txtdb/nada3/sxml/sheets.sxml @@ -26,13 +26,13 @@ (http://www.gnumeric.org/v10.dtd:name "WorkbookView::is_protected") (http://www.gnumeric.org/v10.dtd:value "FALSE"))) (urn:oasis:names:tc:opendocument:xmlns:office:1.0:document-meta (@ (urn:oasis:names:tc:opendocument:xmlns:office:1.0:version "1.2")) (urn:oasis:names:tc:opendocument:xmlns:office:1.0:meta - (http://purl.org/dc/elements/1.1/:date "2013-07-26T04:34:47Z") + (http://purl.org/dc/elements/1.1/:date "2013-07-26T04:47:02Z") (urn:oasis:names:tc:opendocument:xmlns:meta:1.0:creation-date - "2013-07-26T04:34:08Z"))) + "2013-07-26T04:46:14Z"))) (http://www.gnumeric.org/v10.dtd:Calculation (@ (MaxIterations "100") (ManualRecalc "0") (IterationTolerance "0.001") (FloatRadix "2") Index: txtdb/txtdb.scm ================================================================== --- txtdb/txtdb.scm +++ txtdb/txtdb.scm @@ -65,10 +65,11 @@ (define (string->safe-filename str) (string-substitute (regexp " ") "_" str #t)) (define (sheet->refdb dat targdir) (let* ((comment-rx (regexp "^#CMNT\\d+\\s*")) + (blank-rx (regexp "^#BLNK\\d+\\s*")) (sheet-name (car (find-section dat 'http://www.gnumeric.org/v10.dtd:Name))) ;; (safe-name (string->safe-filename sheet-name)) (cells (find-section dat 'http://www.gnumeric.org/v10.dtd:Cells)) (remaining (remove-section (remove-section dat 'http://www.gnumeric.org/v10.dtd:Name) 'http://www.gnumeric.org/v10.dtd:Cells)) @@ -108,13 +109,16 @@ (for-each (lambda (row) (let ((key (car row)) (val (cadr row))) (if (string-search comment-rx key) (print val) - (print key " " val)))) + (if (string-search blank-rx key) + (print) + (print key " " val))))) (reverse (hash-table-ref cols colname))) - (print)) + ;; (print) + ) (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)) @@ -191,11 +195,12 @@ (let ((section-rx (regexp "^\\[(.*)\\]\\s*$")) (comment-rx (regexp "^#.*")) ;; This means a cell name cannot start with # (cell-rx (regexp "^(\\S+) (.*)$")) ;; One space only for the cellname content separator (blank-rx (regexp "^\\s*$")) (inp (open-input-file fname)) - (cmnt-indx (make-hash-table))) + (cmnt-indx (make-hash-table)) + (blnk-indx (make-hash-table))) (let loop ((inl (read-line inp)) (section #f) (res '())) (if (eof-object? inl) (begin @@ -206,11 +211,15 @@ (comment-rx _ (let ((curr-indx (+ 1 (hash-table-ref/default cmnt-indx section 0)))) (hash-table-set! cmnt-indx section curr-indx) (loop (read-line inp) section (cons (list (conc "#CMNT" curr-indx) section inl) res)))) - (blank-rx _ (loop (read-line inp) section res)) + (blank-rx _ (let ((curr-indx (+ 1 (hash-table-ref/default blnk-indx section 0)))) + (hash-table-set! blnk-indx section curr-indx) + (loop (read-line inp) + section + (cons (list (conc "#BLNK" curr-indx) section " ") res)))) (section-rx (x sname) (loop (read-line inp) sname res)) (cell-rx (x k v) (loop (read-line inp) section @@ -353,21 +362,23 @@ ;; call with proc = car to get row names ;; call with proc = cadr to get col names (define (get-rowcol-names path sheet proc) (let ((fname (conc path "/" sheet ".dat")) - (cmnt-rx (regexp "^#CMNT\\d+\\s*"))) + (cmnt-rx (regexp "^#CMNT\\d+\\s*")) + (blnk-rx (regexp "^#BLNK\\d+\\s*"))) (if (file-exists? fname) (let ((dat (read-dat fname))) (if (null? dat) '() (let loop ((hed (car dat)) (tal (cdr dat)) (res '())) (let* ((row-name (proc hed)) (newres (if (and (not (member row-name res)) - (not (string-search cmnt-rx row-name))) + (not (string-search cmnt-rx row-name)) + (not (string-search blnk-rx row-name))) (cons row-name res) res))) (if (null? tal) (reverse newres) (loop (car tal)(cdr tal) newres))))))