# Munge A set of functions that enable you to get blocks of tabular (row and column) data from a variety of sources, manipulate the data in various ways, then store the result as a Rebol/Red block or even save back as a CSV, tab-delimited or Excel file! ## Getting started Download [munge3.r](http://dobeash.com/files/munge3.r), then from a Rebol or Red console: <pre> >> do %munge3.r >> ctx-munge/list [1 2 3] == [ 1 2 3 ] </pre> Alternatively, you can selectively export functions to the global context: <pre> >> ctx-munge/export [list munge] </pre> Or export all functions with: <pre> >> ctx-munge/export bind words-of ctx-munge 'self </pre> ## Data Structure Rows are represented as blocks of data within a "table" block. <pre> >> load-dsv "a,1^/b,2" == [["a" "1"] ["b" "2"]] </pre> ## Reading files ### Delimiter Seperated Values (DSV) <pre> >> load-dsv %file.csv >> load-dsv/part %file.csv 1 >> load-dsv/part %file.csv [1 2] >> load-dsv/where %file.csv [row/1 = 1] </pre> ### Excel <pre> >> load-excel %file.xlsx 'Sheet1 >> load-excel/part %file.xlsx 'Sheet1 1 >> load-excel/part %file.xlsx 'Sheet1 [1 2] >> load-excel/where %file.xlsx 'Sheet1 "F1 = 1" </pre> ### PDF <pre> >> read-pdf %file.pdf >> read-pdf/lines %file.pdf </pre> This requires [pdftotext](http://www.foolabs.com/xpdf/download.html) to be in the same folder as `munge3.r`. ## Writing files ### DSV <pre> >> write-dsv %file.csv block >> write-dsv %file.txt block </pre> ### Excel <pre> >> write-excel %file.xlsx ["Sheet1" [[a b][1 2]] [5 10]] >> write-excel/filter %file.xlsx ["Sheet1" [[a b][1 2]] [5 10]] </pre> This only works on Windows and requires the [Microsoft Access Database Engine 2010 Redistributable](https://www.microsoft.com/en-au/download/details.aspx?id=13255) to first be installed. ## Querying databases ### SQL Server <pre> >> sqlcmd sn db "SELECT * FROM TABLE" >> sqlcmd/headings sn db "SELECT * FROM TABLE" </pre> This will only work on Windows and requires the SQLCMD utility to be installed. ### SQLite <pre> >> sqlite %file.db "SELECT * FROM TABLE" >> sqlite/headings %file.db "SELECT * FROM TABLE" </pre> This requires [sqlite](http://sqlite.org/download.html) to be in the same folder as `munge3.r`. ## Munging blocks The main function, `munge`, is typically used to manipulate blocks of data retrieved from files and databases. ### /where The `/where` refinement lets you specify a block of Rebol conditions (wrapped within an `all` block) that can reference row values as `row/1`, `row/2`, etc). <pre> >> munge/where data [row/1 = 1] >> munge/delete/where data [row/1 > 1 row/1 < 10] >> munge/update/where data [1 row/2] [any [row/1 < 5 row/1 > 10]] </pre> Alternatively, if the data is sorted a key value may be specified. The key value does not need to be unique, but it must be the first value of each row retrieved. <pre> >> sort data >> munge/where data 1 >> munge/delete/where data 1 >> munge/update/where data [1 row/2] 1 </pre> This initiates a [binary search](https://en.wikipedia.org/wiki/Binary_search_algorithm) that can be thousands of times faster than a block predicate. # ctx-munge ##append-column <pre>USAGE: APPEND-COLUMN block value DESCRIPTION: Append a column of values to a block. APPEND-COLUMN is a function! value. ARGUMENTS: block [block!] value REFINEMENTS: /header => heading </pre> ##archive <pre>USAGE: ARCHIVE source DESCRIPTION: Compress block of file and data pairs. ARCHIVE is a function! value. ARGUMENTS: source [series!] </pre> ##ascii-file? <pre>USAGE: ASCII-FILE? source DESCRIPTION: Returns TRUE if file is ASCII. ASCII-FILE? is a function! value. ARGUMENTS: source [file! url!] </pre> ##average-of <pre>USAGE: AVERAGE-OF block DESCRIPTION: Average of values in a block. AVERAGE-OF is a function! value. ARGUMENTS: block [block!] </pre> ##call-oledb <pre>CALL-OLEDB is a none! value: none </pre> ##call-out <pre>USAGE: CALL-OUT cmd DESCRIPTION: Call OS command returning STDOUT. CALL-OUT is a function! value. ARGUMENTS: cmd [string!] </pre> ##check <pre>USAGE: CHECK data DESCRIPTION: Verify data structure. CHECK is a function! value. ARGUMENTS: data [block!] </pre> ##cols? <pre>USAGE: COLS? data DESCRIPTION: Number of columns in a delimited file or string. COLS? is a function! value. ARGUMENTS: data [file! url! binary! string!] REFINEMENTS: /with => delimiter [char!] </pre> ##delimiter? <pre>USAGE: DELIMITER? data DESCRIPTION: Probable delimiter, with priority given to comma, tab, bar, tilde then semi-colon. DELIMITER? is a function! value. ARGUMENTS: data [file! url! string!] </pre> ##delta <pre>USAGE: DELTA source target DESCRIPTION: Remove source rows that exist in target. DELTA is a function! value. ARGUMENTS: source [block!] target [block!] </pre> ##dezero <pre>USAGE: DEZERO string DESCRIPTION: Remove leading zeroes from string. DEZERO is a function! value. ARGUMENTS: string [string!] </pre> ##digit <pre>DIGIT is a bitset! value: make bitset! #{000000000000FFC0} </pre> ##digits? <pre>USAGE: DIGITS? data DESCRIPTION: Returns TRUE if data not empty and only contains digits. DIGITS? is a function! value. ARGUMENTS: data [string! binary!] </pre> ##distinct <pre>USAGE: DISTINCT data DESCRIPTION: Remove duplicate and empty rows. DISTINCT is a function! value. ARGUMENTS: data [block!] </pre> ##enblock <pre>USAGE: ENBLOCK data cols DESCRIPTION: Convert a block of values to a block of row blocks. ENBLOCK is a function! value. ARGUMENTS: data [block!] cols [integer!] </pre> ##enzero <pre>USAGE: ENZERO string length DESCRIPTION: Add leading zeroes to a string. ENZERO is a function! value. ARGUMENTS: string [string!] length [integer!] </pre> ##export <pre>USAGE: EXPORT words DESCRIPTION: Export words to global context. EXPORT is a function! value. ARGUMENTS: words [block!] "Words to export". </pre> ##fields? <pre>USAGE: FIELDS? data DESCRIPTION: Column names in a delimited file or string. FIELDS? is a function! value. ARGUMENTS: data [file! url! string!] REFINEMENTS: /with => delimiter [char!] </pre> ##first-line <pre>USAGE: FIRST-LINE data DESCRIPTION: Returns the first non-empty line of a file. FIRST-LINE is a function! value. ARGUMENTS: data [file! url! string!] </pre> ##flatten <pre>USAGE: FLATTEN data DESCRIPTION: Flatten nested block(s). FLATTEN is a function! value. ARGUMENTS: data [block!] </pre> ##latin1-to-utf8 <pre>USAGE: LATIN1-TO-UTF8 data DESCRIPTION: Latin1 binary to UTF-8 string conversion. LATIN1-TO-UTF8 is a function! value. ARGUMENTS: data [binary!] </pre> ##letter <pre>LETTER is a bitset! value: make bitset! #{00000000000000007FFFFFE07FFFFFE0} </pre> ##letters? <pre>USAGE: LETTERS? data DESCRIPTION: Returns TRUE if data only contains letters. LETTERS? is a function! value. ARGUMENTS: data [string! binary!] </pre> ##like <pre>USAGE: LIKE series value DESCRIPTION: Finds a value in a series, expanding * (any characters) and ? (any one character), and returns TRUE if found. LIKE is a function! value. ARGUMENTS: series [any-string!] "Series to search". value [any-string!] "Value to find". </pre> ##list <pre>USAGE: LIST data DESCRIPTION: Sets the new-line marker to end of block. LIST is a function! value. ARGUMENTS: data [block!] REFINEMENTS: /flat => cols </pre> ##load-dsv <pre>USAGE: LOAD-DSV source DESCRIPTION: Parses delimiter-separated values into row blocks. LOAD-DSV is a function! value. ARGUMENTS: source [file! url! binary! string!] REFINEMENTS: /part => Offset position(s) to retrieve. columns [block! integer!] /where => Expression that can reference columns as row/1, row/2, etc. condition [block!] /with => Alternate delimiter (default is tab, bar then comma). delimiter [char!] /flat => Return a block of values. /ignore => Ignore truncated row errors. </pre> ##load-excel <pre>LOAD-EXCEL is a none! value: none </pre> ##load-fixed <pre>USAGE: LOAD-FIXED file DESCRIPTION: Loads fixed-width values from a file. LOAD-FIXED is a function! value. ARGUMENTS: file [file! url!] REFINEMENTS: /spec => widths [block!] /part => columns [integer! block!] /flat => Return a block of values. </pre> ##map-source <pre>USAGE: MAP-SOURCE source target map DESCRIPTION: Maps source columns to target columns. MAP-SOURCE is a function! value. ARGUMENTS: source [file! url! string!] target [block!] map [map!] REFINEMENTS: /verify => Number of column matches expected. columns [integer!] /load => </pre> ##max-of <pre>USAGE: MAX-OF series DESCRIPTION: Returns the largest value in a series. MAX-OF is a function! value. ARGUMENTS: series [series!] "Series to search". </pre> ##merge <pre>USAGE: MERGE outer key1 inner key2 columns DESCRIPTION: Join outer block to inner block on primary key. MERGE is a function! value. ARGUMENTS: outer [block!] "Outer block". key1 [integer!] inner [block!] "Inner block to index". key2 [integer!] columns [block!] "Offset position(s) to retrieve in merged block". REFINEMENTS: /default => Use none on inner block misses. </pre> ##min-of <pre>USAGE: MIN-OF series DESCRIPTION: Returns the smallest value in a series. MIN-OF is a function! value. ARGUMENTS: series [series!] "Series to search". </pre> ##mixedcase <pre>USAGE: MIXEDCASE string DESCRIPTION: Converts string of characters to mixedcase. MIXEDCASE is a function! value. ARGUMENTS: string [string!] </pre> ##munge <pre>USAGE: MUNGE data DESCRIPTION: Load and/or manipulate a block of tabular (column and row) values. MUNGE is a function! value. ARGUMENTS: data [block!] REFINEMENTS: /update => Offset/value pairs (returns original block). action [block!] /delete => Delete matching rows (returns original block). /part => Offset position(s) and/or values to retrieve. columns /where => Expression that can reference columns as row/1, row/2, etc. condition /group => One of count, max, min or sum. having [word! block!] {Word or expression that can reference the initial result set column as count, max, etc}. </pre> ##oledb-file? <pre>USAGE: OLEDB-FILE? file DESCRIPTION: Returns true for an Excel or Access file. OLEDB-FILE? is a function! value. ARGUMENTS: file [file! url!] </pre> ##order <pre>USAGE: ORDER data columns DESCRIPTION: Orders rows by one or more column offsets. ORDER is a function! value. ARGUMENTS: data [block!] columns [block! integer!] "Offset position(s) to order by". REFINEMENTS: /desc => Descending order. </pre> ##penult <pre>USAGE: PENULT string DESCRIPTION: Returns the second last value of a series. PENULT is a function! value. ARGUMENTS: string [series!] </pre> ##read-binary <pre>USAGE: READ-BINARY source DESCRIPTION: Read bytes from a file. READ-BINARY is a function! value. ARGUMENTS: source [file! url!] REFINEMENTS: /part => Reads a specified number of bytes. length [integer!] /seek => Read from a specific position. index [integer!] </pre> ##read-string <pre>USAGE: READ-STRING source DESCRIPTION: Read string from a text file. READ-STRING is a function! value. ARGUMENTS: source [file! url! binary!] </pre> ##remove-column <pre>USAGE: REMOVE-COLUMN block index DESCRIPTION: Remove a column of values from a block. REMOVE-COLUMN is a function! value. ARGUMENTS: block [block!] index [integer!] </pre> ##replace-deep <pre>USAGE: REPLACE-DEEP data search new DESCRIPTION: Replaces all occurences of a search value with the new value in a block or nested block. REPLACE-DEEP is a function! value. ARGUMENTS: data [block!] "Block to replace within (modified)". search "Value to be replaced". new </pre> ##rows? <pre>USAGE: ROWS? data DESCRIPTION: Number of rows in a delimited file or string. ROWS? is a function! value. ARGUMENTS: data [file! url! binary! string!] </pre> ##second-last <pre>USAGE: SECOND-LAST string DESCRIPTION: Returns the second last value of a series. SECOND-LAST is a function! value. ARGUMENTS: string [series!] </pre> ##sheets? <pre>SHEETS? is a none! value: none </pre> ##split-line <pre>USAGE: SPLIT-LINE line delimiter DESCRIPTION: Splits and returns line of text as a block. SPLIT-LINE is a function! value. ARGUMENTS: line [string!] delimiter [char!] </pre> ##sqlcmd <pre>SQLCMD is a none! value: none </pre> ##sqlite <pre>USAGE: SQLITE database statement DESCRIPTION: Execute a SQLite statement. SQLITE is a function! value. ARGUMENTS: database [file! url!] statement [string!] REFINEMENTS: /key => Columns to convert to integer. columns [integer! block!] /headings => Keep column headings. /string => </pre> ##sum-of <pre>USAGE: SUM-OF block DESCRIPTION: Sum of values in a block. SUM-OF is a function! value. ARGUMENTS: block [block!] </pre> ##to-column-alpha <pre>USAGE: TO-COLUMN-ALPHA number DESCRIPTION: Convert numeric column reference to an alpha column reference. TO-COLUMN-ALPHA is a function! value. ARGUMENTS: number [integer!] "Column number between 1 and 702". </pre> ##to-column-number <pre>USAGE: TO-COLUMN-NUMBER alpha DESCRIPTION: Convert alpha column reference to a numeric column reference. TO-COLUMN-NUMBER is a function! value. ARGUMENTS: alpha [word! string! char!] </pre> ##to-rebol-date <pre>USAGE: TO-REBOL-DATE date DESCRIPTION: Convert a string date to a Rebol date. TO-REBOL-DATE is a function! value. ARGUMENTS: date [string!] REFINEMENTS: /mdy => Month/Day/Year format. /ydm => Year/Day/Month format. /day => Day precedes date. </pre> ##to-rebol-time <pre>USAGE: TO-REBOL-TIME time DESCRIPTION: Convert a string date/time to a Rebol time. TO-REBOL-TIME is a function! value. ARGUMENTS: time [string!] </pre> ##to-string-date <pre>USAGE: TO-STRING-DATE date DESCRIPTION: Convert a string or Rebol date to a YYYY-MM-DD string. TO-STRING-DATE is a function! value. ARGUMENTS: date [string! date!] REFINEMENTS: /mdy => Month/Day/Year format. /ydm => Year/Day/Month format. </pre> ##to-string-time <pre>USAGE: TO-STRING-TIME time DESCRIPTION: Convert a string or Rebol time to a HH:MM:SS string. TO-STRING-TIME is a function! value. ARGUMENTS: time [string! date! time!] </pre> ##unarchive <pre>USAGE: UNARCHIVE source DESCRIPTION: Decompresses archive (only works with compression methods 'store and 'deflate). UNARCHIVE is a function! value. ARGUMENTS: source [file! url! binary!] REFINEMENTS: /only => file [file!] /info => File name/sizes only (size only for gzip). </pre> ##write-dsv <pre>USAGE: WRITE-DSV file data DESCRIPTION: Write block(s) of values to a delimited text file. WRITE-DSV is a function! value. ARGUMENTS: file [file! url!] "csv or tab-delimited text file". data [block!] </pre> ##write-excel <pre>USAGE: WRITE-EXCEL file data DESCRIPTION: Write block(s) of values to an Excel file. WRITE-EXCEL is a function! value. ARGUMENTS: file [file! url!] data [block!] {Name [string!] Data [block!] Widths [block!] records}. REFINEMENTS: /filter => Add auto filter. </pre> # Tests |#|Test|Result| |-:|-|-| |1|append-column [[a] [1]] 2|[[a 2] [1 2]]| |2|append-column/header [[a] [1]] 2 'b|[[a b] [1 2]]| |3|archive ""|none| |4|archive "a"|#{1F8B08000000000002FF4B040043BEB7E801000000}| |5|archive [%a ""]|#{ 504B030414000000000000000000000000000000000000000000010000006150 4B01021400140000000000000000000000000000000000000000000100000000 0000000000000000000000000061504B050600000000010001002F0000001F00 00000000 }| |6|archive [%a "x"]|#{ 504B0304140000000000000000008316DC8C0100000001000000010000006178 504B01021400140000000000000000008316DC8C010000000100000001000000 000000000000000000000000000061504B050600000000010001002F00000020 0000000000 }| |7|archive [%a/ none]|#{ 504B03041400000000000000000000000000000000000000000002000000612F 504B010214001400000000000000000000000000000000000000000002000000 0000000000000000000000000000612F504B0506000000000100010030000000 200000000000 }| |8|archive [%a "1" %b "2"]|#{ 504B030414000000000000000000B7EFDC830100000001000000010000006131 504B0304140000000000000000000DBED51A0100000001000000010000006232 504B0102140014000000000000000000B7EFDC83010000000100000001000000 000000000000000000000000000061504B01021400140000000000000000000D BED51A010000000100000001000000000000000000000000002000000062504B 050600000000020002005E000000400000000000 }| |9|archive [%a "12341234123412341234"]|#{ 504B030414000000080000000000DD14A53C0800000014000000010000006133 3432363144C300504B0102140014000000080000000000DD14A53C0800000014 00000001000000000000000000000000000000000061504B0506000000000100 01002F000000270000000000 }| |10|ascii-file? %test.r|true| |11|ascii-file? %test.xlsx|false| |12|average-of []|none| |13|average-of [1 2]|1.5| |14|call-oledb %test.xlsx "echo munge"|"munge"| |15|call-out {sqlite3.exe a.db ""}|""| |16|check []|true| |17|check [[1]]|true| |18|cols? ""|0| |19|cols? ","|2| |20|cols? "a,b"|2| |21|cols? "a b"|2| |22|cols? "a&#124;b"|2| |23|cols? "a~b"|2| |24|cols? "a;b"|2| |25|cols?/with ":" #":"|2| |26|cols? %test.xlsx|2| |27|cols?/sheet %test.xlsx 'x|0| |28|cols?/sheet %test.xlsx "A B"|2| |29|cols?/sheet %test.xlsx 'AB|2| |30|cols?/sheet %test.xlsx "A-B"|2| |31|delimiter? ""|#","| |32|delimiter? "a"|#","| |33|delimiter? " "|#" "| |34|delimiter? "&#124;"|#"|"| |35|delimiter? "~"|#"~"| |36|delimiter? ";"|#";"| |37|delta [1 2 3] [2]|[1 3]| |38|delta [[1] [2] [3]] [[2]]|[[1] [3]]| |39|dezero ""|""| |40|dezero "0"|""| |41|dezero "10"|"10"| |42|dezero "01"|"1"| |43|dezero "001"|"1"| |44|digit|make bitset! #{000000000000FFC0}| |45|digits? ""|none| |46|digits? "a"|none| |47|digits? "1"|true| |48|distinct [["" ""] [a 1]]|[[a 1]]| |49|distinct [[none none] [a 1]]|[[a 1]]| |50|distinct [[a] [a]]|[[a]]| |51|distinct [[a 1] [a 1]]|[[a 1]]| |52|enblock [1 2 3 4] 1|[[1] [2] [3] [4]]| |53|enblock [1 2 3 4] 2|[[1 2] [3 4]]| |54|enzero "" 1|"0"| |55|enzero "10" 1|"10"| |56|enzero "10" 2|"10"| |57|enzero "10" 3|"010"| |58|export []|[]| |59|export [distinct]|[distinct]| |60|export [cols? rows?]|[cols? rows?]| |61|fields? ""|[]| |62|fields? ","|["" ""]| |63|fields? "a,b"|["a" "b"]| |64|fields? "a:b"|["a:b"]| |65|fields? {"a","b"}|["a" "b"]| |66|fields? {"a" ,"b"}|["a" "b"]| |67|fields? {"a", "b"}|["a" "b"]| |68|fields?/with "a:b" #":"|["a" "b"]| |69|fields? %test.xlsx|["A B" "S1"]| |70|fields?/sheet %test.xlsx 'x|[]| |71|fields?/sheet %test.xlsx "A B"|["A B" "S1"]| |72|fields?/sheet %test.xlsx 'AB|["AB" "S2"]| |73|fields?/sheet %test.xlsx "A-B"|["A-B" "S3"]| |74|first-line ""|""| |75|first-line "a,1"|"a,1"| |76|first-line "^/a,1"|"a,1"| |77|first-line "a,1^/"|"a,1"| |78|flatten []|[]| |79|flatten [[a] [b]]|[a b]| |80|flatten [[a 1] [b 2]]|[a 1 b 2]| |81|latin1-to-utf8 #{}|""| |82|latin1-to-utf8 #{00}|""| |83|latin1-to-utf8 #{C2A0}|" "| |84|latin1-to-utf8 #{FC}|"ΓΌ"| |85|letter|make bitset! #{00000000000000007FFFFFE07FFFFFE0}| |86|letters? ""|true| |87|letters? "a"|true| |88|letters? "1"|false| |89|like "" ""|none| |90|like %abc %a|true| |91|like %abc %*a|true| |92|like %abc %?a|false| |93|like %abc %b|false| |94|like %abc %*b|true| |95|like %abc %?b|true| |96|like %abc %a?c|true| |97|like %abc %a?b|false| |98|like %abc %a*c|true| |99|like %abc %a*b|true| |100|list []|[]| |101|list [a b]|[a b]| |102|list [[a] [b]]|[[a] [b]]| |103|load-dsv ""|[]| |104|load-dsv ","|[["" ""]]| |105|load-dsv {" a^/b" }|[["a b"]]| |106|load-dsv "a,"|[["a" ""]]| |107|load-dsv/part "a,b,c" 1|[["a"]]| |108|load-dsv/part "a,b,c" [1]|[["a"]]| |109|load-dsv/part "a,b,c" [3 1]|[["c" "a"]]| |110|load-dsv/part "a,b,c" [1 "Y"]|[["a" "Y"]]| |111|load-dsv "a,1^/b,2"|[["a" "1"] ["b" "2"]]| |112|load-dsv/where "a,1^/b,2" [row/1 = "a"]|[["a" "1"]]| |113|load-dsv "a:b"|[["a:b"]]| |114|load-dsv/with "a:b" #":"|[["a" "b"]]| |115|load-excel %test.xlsx 1|[["A B" "S1"] ["1" "2"]]| |116|load-excel %test.xlsx "A B"|[["A B" "S1"] ["1" "2"]]| |117|load-excel %test.xlsx 'AB|[["AB" "S2"] ["1" "2"]]| |118|load-excel %test.xlsx "A-B"|[["A-B" "S3"] ["1" "2"]]| |119|load-excel/part %test.xlsx 'AB 1|[["AB"] ["1"]]| |120|load-excel/part %test.xlsx 'AB [2 1]|[["S2" "AB"] ["2" "1"]]| |121|load-excel/where %test.xlsx 'AB "F1 = '1'"|[["1" "2"]]| |122|load-fixed %a.txt|[["1" "2"] ["33" "44"]]| |123|load-fixed/spec %a.txt [3 2]|[["1" "2"] ["33" "44"]]| |124|load-fixed/part %a.txt 1|[["1"] ["33"]]| |125|load-fixed/flat %a.txt|["1" "2" "33" "44"]| |126|map-source "FIRST-NAME" ["FirstName"] make map! []|[[1 "A" "FIRST-NAME" none]]| |127|map-source "FIRST NAME" ["FirstName"] make map! []|[[1 "A" "FIRST NAME" "FirstName"]]| |128|map-source "A" [] make map! ["A" "GivenName"]|[[1 "A" "A" "GivenName"]]| |129|max-of []|none| |130|max-of [1 2]|2| |131|merge [] 1 [] 1 [1]|[]| |132|merge [[a 1] [b 2]] 2 [[1 "A"]] 1 [1 4]|[[a "A"]]| |133|merge [[a 1]] 2 [[2 1] [1 "A"]] 1 [1 4]|[[a "A"]]| |134|merge/default [[a 1] [b 2]] 2 [[1 "A"]] 1 [1 4]|[[a "A"] [b none]]| |135|min-of []|none| |136|min-of [1 2]|1| |137|mixedcase ""|""| |138|mixedcase "aa"|"Aa"| |139|mixedcase "aa bb"|"Aa Bb"| |140|munge []|[]| |141|munge/where [[a] [a] [b]] 'a|[[a] [a]]| |142|munge [[a 1] [b 2]]|[[a 1] [b 2]]| |143|munge/part [[a 1]] 1|[[a]]| |144|munge/part [[a 1]] [2 1]|[[1 a]]| |145|munge/part [[a 1]] [1 "Y"]|[[a "Y"]]| |146|munge/where [[a 1]] [even? row/2]|[]| |147|munge/where [[a 1]] [odd? row/2]|[[a 1]]| |148|munge/where [[a 1] [a 2] [b 3]] 'a|[[a 1] [a 2]]| |149|munge/update [[a 1]] [1 0]|[[0 1]]| |150|munge/update [[a 1]] [1 row/2]|[[1 1]]| |151|munge/update [[a 1]] [1 string!]|[["a" 1]]| |152|munge/update/where [[a 1]] [1 0] 'a|[[0 1]]| |153|munge/update/where [[a 1]] [1 row/2] 'a|[[1 1]]| |154|munge/update/where [[a 1]] [1 string!] 'a|[["a" 1]]| |155|munge/update/where [[a 1]] [1 0] [row/1 = 'a]|[[0 1]]| |156|munge/update/where [[a 1]] [1 row/2] [row/1 = 'a]|[[1 1]]| |157|munge/update/where [[a 1]] [1 string!] [row/1 = 'a]|[["a" 1]]| |158|munge/delete [[a 1] [b 2]]|[]| |159|munge/delete/where [[a 1] [b 2]] 'a|[[b 2]]| |160|munge/delete/where [[a 1] [b 2]] [row/1 = 'a]|[[b 2]]| |161|munge/group [[1] [2]] 'count|[[1 1] [2 1]]| |162|munge/group [[1] [2]] 'avg|1.5| |163|munge/group [[1] [2]] 'sum|3| |164|munge/group [[1] [2]] 'min|1| |165|munge/group [[1] [2]] 'max|2| |166|munge/group [[a] [b] [a]] [count > 1]|[[a 2]]| |167|munge/group [[a 1] [a 2] [b 3]] 'avg|[[a 1.5] [b 3]]| |168|munge/group [[a 1] [a 2] [b 3]] 'sum|[[a 3] [b 3]]| |169|munge/group [[a 1] [a 2] [b 3]] 'min|[[a 1] [b 3]]| |170|munge/group [[a 1] [a 2] [b 3]] 'max|[[a 2] [b 3]]| |171|oledb-file? %tmp|none| |172|oledb-file? %test.r|none| |173|oledb-file? %test.xls|none| |174|oledb-file? %test.xlsx|true| |175|order [[1 a] [1 b] [2 a] [2 b]] 1|[[1 a] [1 b] [2 a] [2 b]]| |176|order [[1 a] [1 b] [2 a] [2 b]] [1 2]|[[1 a] [1 b] [2 a] [2 b]]| |177|order [[1 a] [1 b] [2 a] [2 b]] [2 1]|[[1 a] [2 a] [1 b] [2 b]]| |178|order/desc [[1 a] [1 b] [2 a] [2 b]] 1|[[2 a] [2 b] [1 a] [1 b]]| |179|order/desc [[1 a] [1 b] [2 a] [2 b]] [1 2]|[[2 b] [2 a] [1 b] [1 a]]| |180|order/desc [[1 a] [1 b] [2 a] [2 b]] [2 1]|[[2 b] [1 b] [2 a] [1 a]]| |181|write-dsv %a.txt [[1] [2]] read-string %a.txt|"1^/2^/"| |182|read-binary %sqlite3.exe true|true| |183|read-binary/part %sqlite3.exe 2|#{4D5A}| |184|read-binary/part/seek %sqlite3.exe 1 1|#{5A}| |185|read-string %a.txt|"1^/2^/"| |186|remove-column [[a 1] [b 2]] 1|[[1] [2]]| |187|remove-column [[a 1] [b 2]] 2|[[a] [b]]| |188|replace-deep [a [a]] 'a 'b|[b [b]]| |189|rows? ""|0| |190|rows? "a"|1| |191|rows? "a^/"|2| |192|penult []|none| |193|penult [1]|none| |194|penult [1 2]|1| |195|penult [1 2 3]|2| |196|second-last ""|none| |197|second-last "1"|none| |198|second-last "12"|#"1"| |199|second-last "123"|#"2"| |200|sheets? %test.xlsx|["A B" "AB" "A-B"]| |201|sheets? %test.accdb|["Table 2" "Table1"]| |202|split-line "" #","|[]| |203|split-line "," #","|["" ""]| |204|sqlcmd sn db "select ''"|[]| |205|sqlcmd sn db "select NULL"|[]| |206|sqlcmd sn db "select 1 where 0 = 1"|[]| |207|sqlcmd sn db "select NULL,NULL"|[]| |208|sqlcmd sn db "select 1,NULL"|[["1" ""]]| |209|sqlcmd sn db "select NULL,1"|[["" "1"]]| |210|sqlcmd sn db "select 0"|[["0"]]| |211|sqlcmd sn db "select 0,1"|[["0" "1"]]| |212|sqlcmd sn db "select 0,''"|[["0" ""]]| |213|sqlcmd/key sn db "select 0" 1|[[0]]| |214|sqlcmd/headings sn db "select 1 A"|[["A"] ["1"]]| |215|sqlite %a.db "select ''"|[]| |216|sqlite %a.db "select NULL"|[]| |217|sqlite %a.db "select 1 where 0 = 1"|[]| |218|sqlite %a.db "select NULL,NULL"|[["" ""]]| |219|sqlite %a.db "select 1,NULL"|[["1" ""]]| |220|sqlite %a.db "select NULL,1"|[["" "1"]]| |221|sqlite %a.db "select 0"|[["0"]]| |222|sqlite %a.db "select 0,1"|[["0" "1"]]| |223|sqlite %a.db "select 0,''"|[["0" ""]]| |224|sqlite/key %a.db "select 0" 1|[[0]]| |225|sqlite/headings %a.db "select 1 A"|[["A"] ["1"]]| |226|sum-of []|none| |227|sum-of [1 2]|3| |228|to-column-alpha 1|"A"| |229|to-column-alpha 27|"AA"| |230|to-column-number 'A|1| |231|to-column-number "aa"|27| |232|to-rebol-date "20150201"|1-Feb-2015| |233|to-rebol-date "01-02-2015"|1-Feb-2015| |234|to-rebol-date/mdy "01-02-2015"|2-Jan-2015| |235|to-rebol-date/day "Mon 01-02-2015"|1-Feb-2015| |236|to-rebol-time "1:00AM"|1:00| |237|to-rebol-time "1:00PM"|13:00| |238|to-rebol-time "1:00 AM"|1:00| |239|to-rebol-time "1:00 PM"|13:00| |240|to-string-date "01-02-68"|"2068-02-01"| |241|to-string-date "01-02-69"|"1969-02-01"| |242|to-string-date 1-Feb-2015|"2015-02-01"| |243|to-string-date "20150201"|"2015-02-01"| |244|to-string-date "01/02/2015"|"2015-02-01"| |245|to-string-date/mdy "01/02/2015"|"2015-01-02"| |246|to-string-date/ydm "15/02/01"|"2015-01-02"| |247|to-string-date "01-02-2015"|"2015-02-01"| |248|to-string-date/mdy "01-02-2015"|"2015-01-02"| |249|to-string-date/ydm "15-02-01"|"2015-01-02"| |250|to-string-time 1:00|"01:00:00"| |251|to-string-time "013000000"|"01:30:00"| |252|to-string-time "1:00AM"|"01:00:00"| |253|to-string-time "1:00 AM"|"01:00:00"| |254|to-string-time "1:00PM"|"13:00:00"| |255|to-string-time "1:00 PM"|"13:00:00"| |256|unarchive r0|"a"| |257|unarchive r1|[%a #{}]| |258|unarchive r2|[%a #{78}]| |259|unarchive/info r2|[%a 1]| |260|unarchive/only r2 %a|#{78}| |261|unarchive/only r2 %b|none| |262|unarchive r3|[%a/ none]| |263|unarchive r4|[%a #{31} %b #{32}]| |264|unarchive r5|[%a #{3132333431323334313233343132333431323334}]| |265|write-dsv %a.txt [] read-string %a.txt|""| |266|write-dsv %a.txt [[]] read-string %a.txt|""| |267|write-dsv %a.csv [[a 1] [b 2]] read-string %a.csv|"a,1^/b,2^/"| |268|write-dsv %a.txt [[a 1] [b 2]] read-string %a.txt|"a 1^/b 2^/"| |269|write-excel %a.xlsx ["A" [[A B] [1 2]] [5 10]]|%a.xlsx| |270|write-excel/filter %a.xlsx ["A" [[A] [B]] [5]]|%a.xlsx|