qtxie on self
FEAT: preliminary work for stor… (compare)
@GiuseppeChillemi, there are now 6 of us dedicated full time to Red, and another 6 or so that contribute regularly but have other primary jobs. Then there is a wider circle in the community with some deep work done. e.g. @rcqls on GTK and @hiiamboris on tickets requiring deep analysis and R/S skills. Respective roles, in general:
Warp, Rebolek, Peter, Harald, Semseddin, GregT, Gabriele work on many things, because so much support is needed. Infrastructure, testing, research, codecs, blockchain R&D, docs, deep design. I wish I could name everyone and list their contributions, because they (you) all deserve it, but that's yet another task I'd have to put on my list. ;^)
load-csv/with #";"
returns an error stating, that delimiter
can't be a char!
type, though its help string states otherwise. And lastly - why some lines are enclosed in quotes, whereas most of the lines are enclosed in {}?
load-csv/header
returns a map?
""
vs {}
came up not long ago. It's Rebol's design, and confuses people. Beyond 50 chars the runtime molds strings with {}
instead of ""
. If, for example, truncated console output always added a closing }
that would be useful, because you could persist console sessions.
Object help alignment looks like a bug/regression. @bitbegin, I hate to say it, but it was your recent help changes that caused it.
why default mode returns block, whereas load-csv/header returns a map?
The rationale here is that /header
means it should be used, not just that it exists. If you want the default format, and to separate the header, we (you? ;^) can add an example like this to the wiki page:
>> s: {a,b,c^/1,2,3^/4,5,6}
== "a,b,c^/1,2,3^/4,5,6"
>> data: load-csv s
== [["a" "b" "c"] ["1" "2" "3"] ["4" "5" "6"]]
>> hdr: take data
== ["a" "b" "c"]
>> data
== [["1" "2" "3"] ["4" "5" "6"]]
`data: read/lines %file.csv
, remove first data
if there is header present ... and then finally the loop foreach row data [items: parse/all data ";" ....]
.... done ....
The truth is that I never faced other delimiter than semicolon.
CSV is comma separated values, so comma is used as default separator. Anyway, loading data with semicolon should be as easy as load-csv/with data #";"
. If it doesn't work, there may be a bug. We have tests for it, but I could have overlooked something, that's possible.
>> load-csv/with {a;b;c^/1;2;3^/4;5;6} #";"
== [["a" "b" "c"] ["1" "2" "3"] ["4" "5" "6"]]
Anyway, what you describe parse data #";"
is simply not enough, you were lucky if it worked always for you, or you had used very simple data.
>> to-csv/with [["@pekr" {convert this ; with your "parse loop"}]["@pekr" "I think it won't work"]] #";"
== {@pekr;"convert this ; with your ""parse loop"""^/@pekr;"I think it won't work"^/}
>> data: load-csv/with ";" "12345;Krenzelok;Petr;;19.12.2018;;19.12.2018;19.12.2018;"
== [[""]]
>> data: load-csv/with #";" "12345;Krenzelok;Petr;;19.12.2018;;19.12.2018;19.12.2018;"
*** Script Error: load-csv does not allow char! for its data argument
*** Where: load-csv
*** Stack: load-csv