[Gretl-users] year and period

Ignacio Diaz-Emparanza ignacio.diaz-emparanza at ehu.es
Fri May 23 09:32:56 EDT 2008


El Friday 23 May 2008 14:25:41 Riccardo (Jack) Lucchetti escribió:
>
> If you're using CVS or the snapshot, you can use one of the latest bright
> inventions by Allin, that is sscanf:
>
> <script>
> open data9-3
> scalar endobs=lastobs(reskwh)
> sprintf send "%s", date(endobs)
> scalar yr
> scalar qt
> sscanf send "%d:%d", yr, qt
> </script>
>

Thank you, Jack. This works ok. I needed this variables as strings so I only 
had to add the lines

sprintf year "%4f", yr
sprintf quarter "%2f", qt

to your script. Now the numbers are saved in the strings @year and @quarter


-- 
Ignacio Diaz-Emparanza  
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)                                        
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es 



More information about the Gretl-users mailing list