On Thu, 1 Oct 2020, Sven Schreiber wrote:
Am 01.10.20 um 10:40 schrieb Filipe Costa:
> Glad to help uncover any bug Allin!
>
> I think I'm not able to install the update from git on Arch (eventually I
> don't have the skill). Any workaround on the code that can make it work if
> the session is saved and reopened later? You wrote about the unescaped
"&"
> as being the problem. What can I do there exactly?
The .gretl session files are "just" a gzipped collection of XML files
AFAIK. So unzip the myfile.gretl archive file to get a folder; inside
that folder there should be a "model.1" file, and inside that file you
have the problematic line with the unescape ampersand:
ERR = kfilter(&kb)
I _think_ it should be enough the replace the "&" with the corresponding
xml code: "&" (without the quotes). Then save the file and gzip the
whole previously extracted folder again into a .gretl archive file; try
to reload with gretl.
Since you're on Linux, you may find this little bash script helpful:
<shell-script>
#!/bin/sh
if [[ -z $1 ]]
then
echo "Usage; fix-sessionfile <session file name>"
exit 1
fi
FN=$(basename $1 .gretl)
DIR=.$FN
rm -rf $DIR
unzip $1
LIST=$(grep -l \& $DIR/*)
for f in $LIST
do
sed $f -i -e 's/&/&/g'
done
zip tmp.zip -r $DIR
mv tmp.zip "$FN-fixed.gretl"
</shell-script>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------