Yes thanks - auto correct strikes again! On Dec 7, 2013 7:55 AM, "Devon McCormick" <[email protected]> wrote:
> Ric, of course, means LFs on Linux versus CR-LFs on Windows. > > > On Fri, Dec 6, 2013 at 1:53 PM, Ric Sherlock <[email protected]> wrote: > > > The 45 that was output refers to the number of bytes written. The > > difference between 45 and 47 is likely due to the LF line endings on > Linux > > vs CRTs on Windows. > > I think the error you are getting regarding chopstring is because you > have > > an old version of the base library. That verb should be defined in the > > strings script which is part of the base library. Use the J package > manager > > to update your base library. > > HTH. > > Ric > > On Dec 7, 2013 4:25 AM, "Jon Hough" <[email protected]> wrote: > > > > > I am a complete beginner to J. I am attempting to write and read CSV > > files. > > > > > > My initial attempt is to follow this method: > > > http://www.jsoftware.com/jwiki/Addons/tables/csv > > > > > > I am using J-602 on 32-bit Linux. > > > My attempt has some differences to the output shown in the example. > > > > > > dat writecsv jpath '~temp/test.csv' > > > 45 > > > > > > When I attempt this function it outputs 45, not 47 as in the example. > > > (Not that I really know what either indicate at the moment). > > > > > > Then when I try to read the csv table, which does exist in my temps > > > directory, > > > I get this output: > > > > > > ]datcsv=: freads jpath '~temp/test.csv' > > > 34,"45","hello",-5.34 > > > 12,"32","goodbye",1.23 > > > > > > fixcsv datcsv > > > |value error: chopstring > > > | >msk <@(x&chopstring);._2 y > > > > > > And then I do the following: > > > > > > chopstring > > > |value error: chopstring > > > > > > and: > > > > > > fixcsv > > > ┌────────────┐ > > > │fixcsv_pcsv_│ > > > └────────────┘ > > > > > > and: > > > > > > writecsv > > > ┌──────────────┐ > > > │writecsv_pcsv_│ > > > └──────────────┘ > > > > > > I am not sure what the final two outputs mean, but the > > > > > > |value error: chopstring > > > > > > appears to indicate that the function (verb?) chopstring does not > exist. > > > > > > I am really interesting in using J to analyze datasets from CSV files, > > and > > > although I as a complete beginner, I would appreciate any help. > > > > > > Regards, > > > Jon > > > > > > ---------------------------------------------------------------------- > > > 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 > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
