Page 1 of 1

Import CSV as numeric

Posted: Tue Apr 04, 2017 7:43 am
by BigD
Hi,

I have a CSV file I'd like to import. I've used the pageload command and the import command for this. But no matter what, the series are imported as alphas. Especially those that have "NA"s before numbers. When I imported it manually, the series came out as numeric. Is there a workaround for this?

I've attached my CSV file.

Here are the codes I've tried:

Code: Select all

import(page=Newdata) %myfile ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=comma byrow colhead=2 namepos=first eoltype=pad badfield=NA @freq {%frequency} @smpl @all

Code: Select all

pageload %myfile ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=comma byrow colhead=2 namepos=first eoltype=pad badfield=NA @freq {%frequency} @smpl @all
%myfile is the file path to the CSV.
{%freqeuncy} is just a variable that holds either a, q, or m. This CSV has a monthly frequency so {%frequency} becomes m.

Thanks!

Re: Import CSV as numeric

Posted: Tue Apr 04, 2017 8:49 am
by EViews Gareth
Use the na="NA" argument.

Re: Import CSV as numeric

Posted: Tue Apr 04, 2017 9:19 am
by BigD
Thank you so much. :D :D :D