Importing data from .csv files, prompt and matched dates

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

Importing data from .csv files, prompt and matched dates

Postby fmramos » Mon Feb 05, 2024 1:34 pm

Hi there, EV team!

A question about the "import" command. I'm trying to import a CSV file. Through visual clicks I managed well to import the data and asking the EV to read data and match dates in a d7 frequency. However, when I do it through a .prg file, I continue to receive the prompt asking to select, for instance, the import method (sequential, matched read, append to the end etc). Help files didn't help me in trying to avoid the prompt and simply saying to apply a matched read automatically. Any clues?

I'm doing something like:

import C:\xxx\xxxx\xxxx\file.csv ftype=ascii rectype=crlf skip=0 fieldtype=delimited custom=";" mult colhead=1 namepos=custom eoltype=pad badfield=NA @freq D7 @id @date(date) @destid @date @smpl @all

When inside the prompt window, I just have to click on "matched read". However, I'd like to impose this into the command, avoiding the prompt.

Any help is welcomed.


Tks, Fabio

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Importing data from .csv files, prompt and matched dates

Postby EViews Gareth » Mon Feb 05, 2024 2:41 pm

Can you upload the file?
Follow us on Twitter @IHSEViews

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

Re: Importing data from .csv files, prompt and matched dates

Postby fmramos » Tue Feb 06, 2024 2:13 pm

Sure! Tks for the prompt replying, Gareth (and have a great year!).

File attached, ";" as columns delimiter. Dates in the format yyyymmdd. Best, Fabio.
Attachments
df_tmp.csv
(165.04 KiB) Downloaded 28 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Importing data from .csv files, prompt and matched dates

Postby EViews Gareth » Tue Feb 06, 2024 2:35 pm

Seems to work fine for me. Is your copy of EViews up to date?
fab.gif
fab.gif (1.53 MiB) Viewed 550 times
Follow us on Twitter @IHSEViews

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

Re: Importing data from .csv files, prompt and matched dates

Postby fmramos » Tue Feb 06, 2024 3:09 pm

So weird. I'm using EV13, 8 Jan build, which is the latest update, as per what I noticed. I keep getting a prompt as per the screenshot below :( I'm trying to figure out what is happening, too. :?:
Attachments
Screenshot 2024-02-06 190625.jpg
Screenshot 2024-02-06 190625.jpg (113.8 KiB) Viewed 542 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Importing data from .csv files, prompt and matched dates

Postby EViews Gareth » Tue Feb 06, 2024 3:15 pm

Try running it in an program, not as a command.
Follow us on Twitter @IHSEViews

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

Re: Importing data from .csv files, prompt and matched dates

Postby fmramos » Tue Feb 06, 2024 4:31 pm

It worked :)

I (think I) figured out what was going on. It works if the import process happens as an irregular file. So... I Need to regularize after. The series I get is mostly 5 (trading) days/week, but sometimes we have 7 days/week with empty cells, and some days with 5d/week with NA... So... The app can't read data as regular. The clash of regular vs. irregular data might cause problems. Better to add pagestruct(reg) for tons of series with daily data.

Well, a problem with data series standardization...

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Importing data from .csv files, prompt and matched dates

Postby EViews Gareth » Tue Feb 06, 2024 4:35 pm

More specifically, when issuing a command, EViews presumes you're sat there willing to input something, so if there is a doubt about what's going on, EViews is more willing to prompt you with some options.

If you're running a program, EViews assumes you don't want to be prompted, so goes with a default.
Follow us on Twitter @IHSEViews

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

Re: Importing data from .csv files, prompt and matched dates

Postby fmramos » Tue Feb 06, 2024 4:36 pm

Image below.Tks.
Attachments
bScreenshot 2024-02-06 203531.jpg
bScreenshot 2024-02-06 203531.jpg (41.64 KiB) Viewed 532 times


Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 25 guests