require 'files strings' trim=: ] #~ [: -. [: (*./\. +. *./\) = split=: 3 : 0 NB. [comment] split filepath 'NB.' split y. : t=. LF,toJ fread y. IC=. I. (LF,x.) E. t NB. section comments IL=. I. LF E. t NB. new lines M=. 1,-.2(_1&=@-/@(IL&i.))\IC NB. non-continued indeces s=. t <;.1~ (i.#t) e. M#IC NB. split by ^^^ LF trim &.> s ) safestitch=: (>./&#{.[) ,. (>./&#{.]) textjoin=: ,. & (([: > [: <;._2 ,&LF)&.>) unframe=: 3 : 0 NB. removes x.'s from head and tail of y. i=. I.'+'&= {.y. j=. I.'+'&= {."1 y. (}:@}.@|:)^:2 ' ' j} ' ' i} "1 y. ) htmljoin=: 3 : 0 NB. [header[;footer]] htmljoin a ,. b '' htmljoin y. : 'h f'=. 2{.boxopen x. y.=. ('&';'&';'<';'<';'>';'>')&stringreplace &.> y. y.=. ('
'"_  , ] , '
'"_) &.> y. y.=. ;(''"_ , ] , ('',LF)"_ ) &.> <@:;"1 y. h,'',y.,'
',f ) header=: 0 : 0 J vs K by Example ) footer=: '' 0 : 0 NB. examples: config, select, press Ctrl+E DIR=. 'D:\Math\jbyeg\' jfile=. DIR,'jbyeg\jbyeg.txt' kfile=. DIR,'kbyeg\kbyeg.txt' tfile=. DIR,'jkbyeg.txt' hfile=. DIR,'jkbyeg.htm' sj=. split jfile [ sk=. '/' split kfile hfile fwrite~ (header;footer) htmljoin sj safestitch sk tfile fwrite~ ,,&LF"1 unframe": sj textjoin sk )