Dear all,
I am trying to load the variable "p1" from the following csv-file:
// Ex1.csv
/*=================================================================
"hs","cty_code","all_val_mo","p1","p2"
"0101110000","1220",60600, .5713,"."
"0101110000","2010",11700, .4286,"."
=================================================================*/
My code is:
//Main Program
//=================================================================
#include <oxstd.h>
#import <database>
#include <oxfloat.h>
main()
{
decl dbase = new Database();
dbase.Load("Ex1.csv");
decl p1 = dbase.GetVar("p1");
print("p1:",p1);
}
//=================================================================
Unfortunately, my output is:
//Output
/*=================================================================
Ox version 4.04 (Windows) (C) J.A. Doornik, 1994-2006
This version may be used for academic research and teaching only
p1:
0.00000
1.0000
=================================================================*/
The reported values should have been p1=(.5713,.4286)'.
Any suggestions on how to "correct" this problem would be greatly
appreciated (I should note that I am working with very large csv files so
simply modifying the csv file by "hand" is not an option)
Cheers,
Christian M. Dahl
Associated Prof.
Purdue University
|