i see. seems what you then need is something like the code below, where you are executing the same command(s) on different sets of variables. below i show how to submit different variables, read from different files, and operate on them as a whole, or individually. the macro language is somewhat clunky and limited, but quite powerful once you figure out how to get around these limitations. you can copy and paste the code below onto your syntax window and run it. it does not read any file, it simply writes text to your screen. i hope this helps.
define !test (indir = !charend('/') /
infile = !charend('/') /
vars = !charend('/') ).
echo "* * *".
echo !quote(!concat("Read this file: ",!indir,"\",!infile,".sav")).
echo !quote(!concat("Run the analysis with these variables: ",!vars)).
!do !v !in(!vars)
echo !quote(!concat("And now one by one: ",!v)).
!doend
echo "* * *".
!enddefine.
!test indir = c:\temp / infile=file1 / vars=a b c.
!test indir = c:\temp / infile=file2 / vars=d e f.
!test indir = c:\temp / infile=file3 / vars=g h i.
------------------------------
Eugenio Gonzalez
------------------------------
Original Message:
Sent: Fri January 08, 2021 11:06 AM
From: Aicko Yves Schumann
Subject: Reload / Update Open File
Hello Eugenio,
thank you for your suggestion!
Unfortunately, this is a very different use case. I have a syntax file with many complex commands open. Then let's say I want to run them quickly for other variables, i.e. I would need to do a quick cut and paste with substituting hundreds of variables. These batch substitution things can be efficiently done with vim (or emacs, though I am a vi-guy) using regular expressions. Manually achieving the same result within SPSS is often impossible or would take hours of manual editing with the risk of making mistakes/typos. External editors also allow for need features like folding syntax or custom syntax highlighting of e.g. Python code or custom macros/functions; all important features that do not exist in the basic SPSS editor. Ideally, I would like to toss SPSS' editor altogether and execute commands out of vim directly. At any time I have many .sps/.sav files open and navigating between them is tedious and requires the mouse or looping through the window list (e.g. Alt+Tab). An external editor allows you to jump directly from file to file with a simple control sequence, i.e. it is much faster and does not require grabbing the mouse.
Best,
Aicko
------------------------------
Aicko Yves Schumann
Original Message:
Sent: Fri January 08, 2021 10:10 AM
From: Eugenio Gonzalez
Subject: Reload / Update Open File
hi aicko,
not sure this quite solves your problem, but here i go: i usually create syntax using an external editor, any editor, and save it as text file. then in the SPSS syntax window i use INCLUDE FILE = to include the syntax to run. surely, whenever you make changes with the external editor you would need to save them to be INCLUDEd in the syntax.
when needed, i save multiple versions of the syntax using the external editor, and modify the file name in the INCLUDE command, or add separate INCLUDE commands for each file. i understand now there is also INSERT which pretty much does the same thing.
i hope you find this helpful.
------------------------------
Eugenio Gonzalez
Original Message:
Sent: Thu January 07, 2021 01:30 PM
From: Aicko Yves Schumann
Subject: Reload / Update Open File
Hello Community,
is there a convenient way to reload an updated syntax file (or really any file) without closing the currently open version and reopening the updated file? The need occurs when I use an external editor (e.g. vim) to efficiently do complex and/or massive edits which the GUI editor does not provide.
Alternatively, is there an approach or initiative to incorporate professional editors like vim or emacs into the GUI as can be done in several other frontends / software packages?
Thank you for your input!
Best,
Aicko
------------------------------
Aicko Yves Schumann
------------------------------
#SPSSStatistics