Building file paths from an external ascii file

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Posts: 1
Joined: Thu Nov 13, 2014 3:29 pm

Building file paths from an external ascii file

Postby Jon_Roland » Thu Nov 13, 2014 3:33 pm

I have many SPSS scripts containing lines like this:

file handle somename /name = 'S:\folder1\2014\14_Q3\somedata14_Q3.sav'.

and I have created a tab-separated ascii file like this, named "workfile.txt":

2014 3 140701 141031

I am trying to use "get translate" to read workfile.txt for the field values and insert them into the lines that might be edited to be

compute file handle somename /name = concat( 'S:\folder1\', var1, '\', substr(var1, 3, 2), '_Q', var2, '\somedata', substr(var1, 3, 2), '_Q', var2, '.sav').


So that all the SPSS scripts would work as before but be controlled by the single file workfile.txt, but I am getting error messages. Can someone suggest how to do this?

Who is online

Users browsing this forum: No registered users and 3 guests