Interesting. You get different results to me. Are you using the tables/csv addon and if so which version?
load 'pacman' 'search' jpkgv 'csv' ┌──────────┬─────┬─────┬────────────────────────────────────┐ │tables/csv│1.0.7│1.0.7│Read and write CSV files and strings│ └──────────┴─────┴─────┴────────────────────────────────────┘ load 'tables/csv' (i. 5 5) writecsv '~temp/foo.csv' 70 fread '~temp/foo.csv' 0,1,2,3,4 5,6,7,8,9 10,11,12,13,14 15,16,17,18,19 20,21,22,23,24 On Wed, Jan 4, 2012 at 1:43 PM, Devon McCormick <devon...@gmail.com> wrote: > (i. 5 5) writecsv 'foo.csv' > 120 > fread 'foo.csv' > "0","1","2","3","4" > "5","6","7","8","9" > "10","11","12","13","14" > "15","16","17","18","19" > "20","21","22","23","24" > > Also, I was long under the impression that literal data in a csv file > should be quoted but apparently this is not the case. It's hard to say for > sure as there is no real spec for this format, and I don't remember what > disabused me of this notion (perhaps taking the behavior of Excel as the > paradigm?) > > On Tue, Jan 3, 2012 at 6:35 PM, Ric Sherlock <tikk...@gmail.com> wrote: > >> Note that the tables/csv addon is just a special case of the >> tables/dsv addon that sets the delimiters. From memory the tables/csv >> addon will quote literal data but not numeric data. Of course that >> means that numbers in literal form will end up being quoted. >> >> When you refer to "spurious" double-quotes, are there occasions where >> quotes appear that they shouldn't? >> >> On Wed, Jan 4, 2012 at 9:59 AM, Devon McCormick <devon...@gmail.com> >> wrote: >> > At some of the recent NYCJUGs, Ken Lettow pointed me to the "dsv" >> versions >> > of this which are more general ("Delimiter-Separated Values"). I use >> these >> > now as I usually prefer tab-delimited files and want to avoid the >> spurious >> > double-quotes the "csv" modules put around data. See >> > http://www.jsoftware.com/jwiki/Addons/tables/dsv?highlight=%28dsv%29 . >> > >> > On Mon, Jan 2, 2012 at 12:59 PM, Tom Szczesny <tav...@gmail.com> wrote: >> > >> >> When I try require 'csv' I get >> >> not found: /home/tom/jgplsrc/j/addons/tables/csv/csv.ijs >> >> >> >> However, I can get to >> >> http://www.jsoftware.com/jwiki/Addons >> >> I should be able to get what I need from there. >> >> >> >> Thanks. >> >> >> >> >> >> On Mon, Jan 2, 2012 at 12:38 PM, Raul Miller <rauldmil...@gmail.com> >> >> wrote: >> >> >> >> > Try this: >> >> > >> >> > require 'csv' >> >> > >> >> > T=: readcsv '/home/tom/t.csv' >> >> > >> >> > -- >> >> > Raul >> >> > >> >> > On Mon, Jan 2, 2012 at 12:22 PM, Tom Szczesny <tav...@gmail.com> >> wrote: >> >> > > Some languages, like q, have a built-in command for reading, >> parsing, >> >> and >> >> > > loading data from csv files: >> >> > > t: ("SSDIDSSIFFFIS";enlist ",") 0: `:/home/tom/t.csv >> >> > > >> >> > > Other languages, like a+, do not, and the user needs to write a >> >> function >> >> > to >> >> > > read, parse and load data from csv files. >> >> > > >> >> > > From a cursory review, it appears that j is in the a+ camp. >> >> > > Please confirm that such a facility does not exist in j, before I >> start >> >> > > writing my own. >> >> > > >> ---------------------------------------------------------------------- >> >> > > For information about J forums see >> http://www.jsoftware.com/forums.htm >> >> > ---------------------------------------------------------------------- >> >> > For information about J forums see >> http://www.jsoftware.com/forums.htm >> >> > >> >> ---------------------------------------------------------------------- >> >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> >> > >> > >> > >> > -- >> > Devon McCormick, CFA >> > ^me^ at acm. >> > org is my >> > preferred e-mail >> > ---------------------------------------------------------------------- >> > For information about J forums see http://www.jsoftware.com/forums.htm >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > > > > -- > Devon McCormick, CFA > ^me^ at acm. > org is my > preferred e-mail > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm