Using ADD FILES with spaces in file names

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

abramrickards
Posts: 3
Joined: Wed Feb 15, 2012 3:12 pm

Using ADD FILES with spaces in file names

Postby abramrickards » Wed Feb 15, 2012 3:18 pm

Hi all! Great forum you have here. I have a question regarding how to use the ADD FILES command to append new cases to existing files. Specifically, I have multiple files I want to append together that contain spaces within their file names. I've provided the code below as an example:

ADD FILES FILE="C:\Users\kdowd\Desktop\output\log\coef\S1_PF\101\Table_Variables in the Equation_1.sav
/FILE="C:\Users\kdowd\Desktop\output\log\coef\S1_PF\102\Table_Variables in the Equation_1.sav

Running this syntax produces errors and SPSS appears to only recognize the file name up to 'Variables' and ignore the rest. The errors I received led me to believe that replacing each space with a '+' would remedy the problem, but that didn't help either.

Any suggestions?
abramrickards
Posts: 3
Joined: Wed Feb 15, 2012 3:12 pm

Re: Using ADD FILES with spaces in file names

Postby abramrickards » Wed Feb 15, 2012 3:44 pm

I figured out my own problem. If your file names have spaces in them you have to wrap your file name in single quotes (') instead of double quotes ("). This causes SPSS to recognize spaces in file names.
JonPedersen
Posts: 117
Joined: Wed May 25, 2011 7:07 am
Contact:

Re: Using ADD FILES with spaces in file names

Postby JonPedersen » Thu Feb 16, 2012 3:38 am

Hi,
Actually, that is not correct, at least not in any version of SPSS I have tried (. You forgot the closing double quote in the original syntax for both files.
best,
Jon

Who is online

Users browsing this forum: No registered users and 1 guest

cron