---Steven Taylor wrote:
> could someone take a quick look at this csv import? What is 
> the best way to go about this?
> 
> NB. the csv 'L1.csv'
> 0,0.014648428,0.343476414,-0.105340538,1.565688588
>   NB. end of csv
> 
> load 'csv'
> aaa=:readcsv jpath 'G:\J\data\l1.csv'
>  aa=:fixcsv aaa
> 
> |length error: fixcsv
> |   >msk    <@chopcsv;._2 y
> 
> a=:makenum aa

I think Björn has identified the key issue. 

In case there is any confusion I'd like to point out that, from your use of 
makenum, you are using probably using the 'tables/csv' addon rather than the J 
package '~system/packages/files/csv.ijs'
Normally load 'csv' would load the J package but I suspect you have followed 
the install directions on the jwiki/Addons/tables/csv page to replace the 'csv' 
entry in PUBLIC_j_.
I think in the medium-term the intent is that the addon will replace the use of 
the system library.

   ]a=: makenum readcsv jpath 'G:\J\data\l1.csv'
0 0.014648428 0.34347641 _0.10534054 1.5656886
   $a
1 5

fixcsv is useful if the csv string has already been read in to J.

   ]aa=: makenum fixcsv freads jpath '~temp/tstcsv.csv'
0 0.014648428 0.34347641 _0.10534054 1.5656886
   $aa
1 5

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to