Page 1 of 1

Reading txt-file, special case

Posted: Tue Mar 04, 2014 3:27 am
by johansamuelsson
Hi

I'm making a API-call via a VBA-script in order to get some data. The VBA-script creates a txt-file (see attached file).

I'm using

Code: Select all

wfopen "G:\Pro\Led\ProcessMetod\Api\Data\Data.Txt" skip=1 colhead=1 delim="," byrow pagestruct(freq=q, start=1993)
I have problem to tranforme the data from alphaseries to timeseries. I've tried using

Code: Select all

types = "f"
but Eviews transform wrong because I have space delimiter characters in the numbers?

How to do?

Regards Johan

Re: Reading txt-file, special case

Posted: Tue Mar 04, 2014 9:03 am
by EViews Gareth
Just so I understand correctly, the number:

Code: Select all

385 179
is actually one number (385179)?

Re: Reading txt-file, special case

Posted: Tue Mar 04, 2014 11:31 am
by johansamuelsson
Yes

Re: Reading txt-file, special case

Posted: Tue Mar 04, 2014 12:16 pm
by EViews Chris
I'm afraid you'll have to get rid of those spaces inside the numbers somehow. I don't remember anyone asking us to read in a numeric field formatted like that before and there's currently no built in support for it.

Actually, it turns out they're not ordinary spaces (character code 32) but non-breaking spaces (character code 160) inside your fields which makes it even less likely that we'll handle this automatically.

I think your only option within EViews is to translate the series yourself after loading them in, something like this

series import_av_varor_ = @val(@replace(import_av_varor, @chr(160), ""))

You could loop over all the series in a program by putting the series in a group and translating them within a loop.

Re: Reading txt-file, special case

Posted: Tue Mar 04, 2014 12:46 pm
by johansamuelsson
Ok, thanks