;; emacs edit functions to convert "xacc-txf-categories.html" to
;; "xacc-txf-categories.sgml"
;; "xacc-txf-categories.html" was exported from the Tax Report "TXF
;; Export Init" tab and boolean: "Print extended TXF HELP messages" v 1.4.10
;; Generates sgml for v 1.5.3 with XML file format as of 2001-Mar-08
;; to convert file:
;; Open... the file: "xacc-txf-categories.html"
;; M-x load-file "html2sgml.el"
;; Save As... "xacc-txf-categories.sgml"
(beginning-of-buffer)
(query-replace "" "\n" nil)
(beginning-of-buffer)
(query-replace "" "" nil)
(beginning-of-buffer)
(query-replace "
" "\n\n" nil)
(beginning-of-buffer)
(query-replace "" "\n" nil)
(beginning-of-buffer)
(query-replace-regexp "title>.*title>" "TITLE>Detailed TXF Category Descriptions" nil)
(beginning-of-buffer)
(query-replace-regexp "" "" nil)
(beginning-of-buffer)
(query-replace-regexp "" "" nil)
(beginning-of-buffer)
(query-replace-regexp "<.*body.*>" "" nil)
(beginning-of-buffer)
(query-replace "b>" "EMPHASIS>" nil)
(beginning-of-buffer)
(query-replace "tr>" "ROW>" nil)
(beginning-of-buffer)
(query-replace "th>" "ENTRY>" nil)
(beginning-of-buffer)
(query-replace-regexp "" "" nil)
(beginning-of-buffer)
(query-replace "td>" "ENTRY>" nil)
(beginning-of-buffer)
(query-replace-regexp " .* " "" nil)
(beginning-of-buffer)
(query-replace-regexp ".*txf-account " "" nil)
(beginning-of-buffer)
(query-replace-regexp "" "\n\nDetailed TXF Category Descriptions\n\n" nil)
(beginning-of-buffer)
(query-replace-regexp "Tax " "\nTax " nil)
(beginning-of-buffer)
(query-replace-regexp " Income Expense\n \n\n \n \n\n" " \n\n \n" nil)
(beginning-of-buffer)
(query-replace-regexp "\222" "'" nil)
(beginning-of-buffer)
(query-replace "" "" nil)
(beginning-of-buffer)
(query-replace " " "" nil)
;; EXECUTE the following macro only on the first " "
(beginning-of-buffer)
(setq last-kbd-macro (read-kbd-macro
"C-s < br > 2* /PARA > < PARA C-s < / PARA > < / C-a C-s \\ < /EMPHASIS >"))
(call-last-kbd-macro)
(end-of-buffer)
(insert "\n\n"
"\n"
"\n")
;; EXECUTE the following macro only on all of the rest of the " "s
(beginning-of-buffer)
;; NOTE: If there are less than 350 " "'s and the last one is
;; replaced, this will fail, ring the bell, and terminate the execution
;; on the this file. SO, this should be the LAST insctuction in this
;; file!
;; IF IT DOES NOT RING THE BELL, SOME 's WERE PROBABLY NOT REPLACED!
;; INCREASE THE "350" COUNT BELOW AND RUN AGAIN!
(execute-kbd-macro (read-kbd-macro
"C-s < br > 2* /PARA > < PARA C-a C-s R Y > < PARA > < C-a C-s < / E N 2* PARA > < /") 350)
|