www.wordsalad.eu

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

www.wordsalad.eu

Albert-Jan Roskam
Hi all,

I made a small web survey on poetry and I would really appreciate it if you would participate. It only takes a few minutes and it is entirely anonymous. You can find it on www.wordsalad.eu.

To make this message a little less 'off-topic': I used Limesurvey to create this survey. Limesurvey is freeware. It's very simple and it works seamlessly with SPSS. It even allows you to generate a .dat file and a .sps file with the needed GET DATA syntax + var labels. It takes very little time to create a survey. The downside is that making larger surveys may take an awful amount of mouse clicks. But then again, in my humble opinion, very long surveys mostly measure mental fatigue. ;-)

Thank you in advance for your time, or in case you didn't want to participate: sorry to have bothered you with this.

Best wishes,
Albert-Jan

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Adding files in a folder

Thien Hop
Hi all,

I have to perform adding many files, many times to run consolidated
analysis. Would much appreciate if any one could advise a macro (for version
12) to automatically do adding all files in a given folder.

Thank you very much!
----- Original Message -----
From: "Albert-Jan Roskam" <[hidden email]>
To: <[hidden email]>
Sent: Friday, March 20, 2009 4:51 PM
Subject: www.wordsalad.eu


> Hi all,
>
> I made a small web survey on poetry and I would really appreciate it if
> you would participate. It only takes a few minutes and it is entirely
> anonymous. You can find it on www.wordsalad.eu.
>
> To make this message a little less 'off-topic': I used Limesurvey to
> create this survey. Limesurvey is freeware. It's very simple and it works
> seamlessly with SPSS. It even allows you to generate a .dat file and a
> .sps file with the needed GET DATA syntax + var labels. It takes very
> little time to create a survey. The downside is that making larger surveys
> may take an awful amount of mouse clicks. But then again, in my humble
> opinion, very long surveys mostly measure mental fatigue. ;-)
>
> Thank you in advance for your time, or in case you didn't want to
> participate: sorry to have bothered you with this.
>
> Best wishes,
> Albert-Jan
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Adding files in a folder

Albert-Jan Roskam
Hi,

Before Python, I'd sometimes use a combination of DOS and Excel to write an ADD FILES syntax.

so in DOS you do:
dir *.sav /b /o /l >d:\temp\sav_files.txt

and then you paste the txt file in Excel and you use something like:
"    /file = '"&A1&"'"
(assuming that you pasted everything in the first column)

Rather low-tech, but it does the job.

ADD FILES works with up to 50 files.

Cheers!!
Albert-Jan

--- On Fri, 3/20/09, Thien Hop <[hidden email]> wrote:

> From: Thien Hop <[hidden email]>
> Subject: Adding files in a folder
> To: [hidden email]
> Date: Friday, March 20, 2009, 12:13 PM
> Hi all,
>
> I have to perform adding many files, many times to run
> consolidated
> analysis. Would much appreciate if any one could advise a
> macro (for version
> 12) to automatically do adding all files in a given
> folder.
>
> Thank you very much!
> ----- Original Message -----
> From: "Albert-Jan Roskam" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, March 20, 2009 4:51 PM
> Subject: www.wordsalad.eu
>
>
> > Hi all,
> >
> > I made a small web survey on poetry and I would really
> appreciate it if
> > you would participate. It only takes a few minutes and
> it is entirely
> > anonymous. You can find it on www.wordsalad.eu.
> >
> > To make this message a little less 'off-topic': I used
> Limesurvey to
> > create this survey. Limesurvey is freeware. It's very
> simple and it works
> > seamlessly with SPSS. It even allows you to generate a
> .dat file and a
> > .sps file with the needed GET DATA syntax + var
> labels. It takes very
> > little time to create a survey. The downside is that
> making larger surveys
> > may take an awful amount of mouse clicks. But then
> again, in my humble
> > opinion, very long surveys mostly measure mental
> fatigue. ;-)
> >
> > Thank you in advance for your time, or in case you
> didn't want to
> > participate: sorry to have bothered you with this.
> >
> > Best wishes,
> > Albert-Jan
> >
> > =====================
> > To manage your subscription to SPSSX-L, send a message
> to
> > [hidden email]
> (not to SPSSX-L), with no body text except the
> > command. To leave the list, send the command
> > SIGNOFF SPSSX-L
> > For a list of commands to manage subscriptions, send
> the command
> > INFO REFCARD
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email]
> (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the
> command
> INFO REFCARD
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Adding files in a folder

Art Kendall
In reply to this post by Thien Hop
if the files are text files and have a file identifier just use a HOST
command.
on windows something like.
host command = 'copy d:\project\raw\*.asc d:\project\combined\combined.asc'.

How are your data stored?  SPSS system files? csv files? etc. Does each
file have a variable that identifies the file? Perhaps each file is for
a city and city is a field in the files?

How many files are you talking about?  (some procedures can only handle
50 at a time.)

Art Kendall
Social Research Consultants

Thien Hop wrote:

> Hi all,
>
> I have to perform adding many files, many times to run consolidated
> analysis. Would much appreciate if any one could advise a macro (for
> version
> 12) to automatically do adding all files in a given folder.
>
> Thank you very much!
> ----- Original Message -----
> From: "Albert-Jan Roskam" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, March 20, 2009 4:51 PM
> Subject: www.wordsalad.eu
>
>
>> Hi all,
>>
>> I made a small web survey on poetry and I would really appreciate it if
>> you would participate. It only takes a few minutes and it is entirely
>> anonymous. You can find it on www.wordsalad.eu.
>>
>> To make this message a little less 'off-topic': I used Limesurvey to
>> create this survey. Limesurvey is freeware. It's very simple and it
>> works
>> seamlessly with SPSS. It even allows you to generate a .dat file and a
>> .sps file with the needed GET DATA syntax + var labels. It takes very
>> little time to create a survey. The downside is that making larger
>> surveys
>> may take an awful amount of mouse clicks. But then again, in my humble
>> opinion, very long surveys mostly measure mental fatigue. ;-)
>>
>> Thank you in advance for your time, or in case you didn't want to
>> participate: sorry to have bothered you with this.
>>
>> Best wishes,
>> Albert-Jan
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>> [hidden email] (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Adding files in a folder

Thien Hop
Thanks Dr Kendall and Albert a lot for your advices. They are all "*.sav"
files. Normally I have less than 50 files at a time, if more than 50 files I
will do it manually.

All files have same key variable to match (serialnum).

Thank you very much

----- Original Message -----
From: "Art Kendall" <[hidden email]>
To: "Thien Hop" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, March 20, 2009 8:01 PM
Subject: Re: Adding files in a folder


> if the files are text files and have a file identifier just use a HOST
> command.
> on windows something like.
> host command = 'copy d:\project\raw\*.asc
> d:\project\combined\combined.asc'.
>
> How are your data stored?  SPSS system files? csv files? etc. Does each
> file have a variable that identifies the file? Perhaps each file is for a
> city and city is a field in the files?
>
> How many files are you talking about?  (some procedures can only handle 50
> at a time.)
>
> Art Kendall
> Social Research Consultants
>
> Thien Hop wrote:
>> Hi all,
>>
>> I have to perform adding many files, many times to run consolidated
>> analysis. Would much appreciate if any one could advise a macro (for
>> version
>> 12) to automatically do adding all files in a given folder.
>>
>> Thank you very much!
>> ----- Original Message -----
>> From: "Albert-Jan Roskam" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Friday, March 20, 2009 4:51 PM
>> Subject: www.wordsalad.eu
>>
>>
>>> Hi all,
>>>
>>> I made a small web survey on poetry and I would really appreciate it if
>>> you would participate. It only takes a few minutes and it is entirely
>>> anonymous. You can find it on www.wordsalad.eu.
>>>
>>> To make this message a little less 'off-topic': I used Limesurvey to
>>> create this survey. Limesurvey is freeware. It's very simple and it
>>> works
>>> seamlessly with SPSS. It even allows you to generate a .dat file and a
>>> .sps file with the needed GET DATA syntax + var labels. It takes very
>>> little time to create a survey. The downside is that making larger
>>> surveys
>>> may take an awful amount of mouse clicks. But then again, in my humble
>>> opinion, very long surveys mostly measure mental fatigue. ;-)
>>>
>>> Thank you in advance for your time, or in case you didn't want to
>>> participate: sorry to have bothered you with this.
>>>
>>> Best wishes,
>>> Albert-Jan
>>>
>>> =====================
>>> To manage your subscription to SPSSX-L, send a message to
>>> [hidden email] (not to SPSSX-L), with no body text except the
>>> command. To leave the list, send the command
>>> SIGNOFF SPSSX-L
>>> For a list of commands to manage subscriptions, send the command
>>> INFO REFCARD
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>> [hidden email] (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Adding files in a folder

Tim AT Home
Here is a modified python chunk I used last year sometime - to add 2000ish
files



BEGIN PROGRAM PYTHON.

import os, sys, spss
#help (spss)

from spss import Submit


########################### VERSION 1 ################################


outpath = "I:\\Work\\Programs\\ConSPSSV1\\"
#print outpath
savext = ".sav"
#print savext


#Need variable to hold all sav filenames within 'outpath' directory
SpssFilesT = os.listdir(outpath)
SpssFiles = sorted(SpssFilesT)
#print SpssFiles


try:
     Submit(r"""
     GET FILE = '%s'.
     EXECUTE.
     """ %(outpath + SpssFiles[0]))
except:
    pass

try:
     #print SpssFiles[1:]
     for addfle in SpssFiles[1:]:
          Submit(r"""
          ADD FILES FILE= *
                   /FILE= '%s'.
          CACHE.
          EXECUTE.
          """ %(outpath + addfle))
except:
    pass




END PROGRAM.


***** END PROGRAM BLOCK .

SAVE OUTFILE=      "added files Raw.sav".








****************************

Notice: This e-mail and any attachments may contain confidential and
privileged information.  If you are not the intended recipient, please
notify the sender immediately by return e-mail, do not use the information,
delete this e-mail and destroy any copies.  Any dissemination or use of this
information by a person other than the intended recipient is unauthorized
and may be illegal.  Email transmissions cannot be guaranteed to be secure
or error free. The sender therefore does not accept any liability for errors
or omissions in the contents of this message that arise as a result of email
transmissions.


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Thien Hop
Sent: March 20, 2009 8:59 AM
To: [hidden email]
Subject: Re: Adding files in a folder

Thanks Dr Kendall and Albert a lot for your advices. They are all "*.sav"
files. Normally I have less than 50 files at a time, if more than 50 files I
will do it manually.

All files have same key variable to match (serialnum).

Thank you very much

----- Original Message -----
From: "Art Kendall" <[hidden email]>
To: "Thien Hop" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, March 20, 2009 8:01 PM
Subject: Re: Adding files in a folder


> if the files are text files and have a file identifier just use a HOST
> command.
> on windows something like.
> host command = 'copy d:\project\raw\*.asc
> d:\project\combined\combined.asc'.
>
> How are your data stored?  SPSS system files? csv files? etc. Does
> each file have a variable that identifies the file? Perhaps each file
> is for a city and city is a field in the files?
>
> How many files are you talking about?  (some procedures can only
> handle 50 at a time.)
>
> Art Kendall
> Social Research Consultants
>
> Thien Hop wrote:
>> Hi all,
>>
>> I have to perform adding many files, many times to run consolidated
>> analysis. Would much appreciate if any one could advise a macro (for
>> version
>> 12) to automatically do adding all files in a given folder.
>>
>> Thank you very much!
>> ----- Original Message -----
>> From: "Albert-Jan Roskam" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Friday, March 20, 2009 4:51 PM
>> Subject: www.wordsalad.eu
>>
>>
>>> Hi all,
>>>
>>> I made a small web survey on poetry and I would really appreciate it
>>> if you would participate. It only takes a few minutes and it is
>>> entirely anonymous. You can find it on www.wordsalad.eu.
>>>
>>> To make this message a little less 'off-topic': I used Limesurvey to
>>> create this survey. Limesurvey is freeware. It's very simple and it
>>> works seamlessly with SPSS. It even allows you to generate a .dat
>>> file and a .sps file with the needed GET DATA syntax + var labels.
>>> It takes very little time to create a survey. The downside is that
>>> making larger surveys may take an awful amount of mouse clicks. But
>>> then again, in my humble opinion, very long surveys mostly measure
>>> mental fatigue. ;-)
>>>
>>> Thank you in advance for your time, or in case you didn't want to
>>> participate: sorry to have bothered you with this.
>>>
>>> Best wishes,
>>> Albert-Jan
>>>
>>> =====================
>>> To manage your subscription to SPSSX-L, send a message to
>>> [hidden email] (not to SPSSX-L), with no body text except
>>> the command. To leave the list, send the command SIGNOFF SPSSX-L For
>>> a list of commands to manage subscriptions, send the command INFO
>>> REFCARD
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>> [hidden email] (not to SPSSX-L), with no body text except
>> the command. To leave the list, send the command SIGNOFF SPSSX-L For
>> a list of commands to manage subscriptions, send the command INFO
>> REFCARD
>>
>>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command SIGNOFF SPSSX-L For a list of
commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Adding files in a folder

Albert-Jan Roskam
In reply to this post by Thien Hop
Hi,

This approach only EXECUTEs every 50th file, which could save a lot of time:
http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0808&L=spssx-l&P=R18467

Cheers!!
Albert-Jan

--- On Fri, 3/20/09, Tim Hennigar <[hidden email]> wrote:

> From: Tim Hennigar <[hidden email]>
> Subject: Re: Adding files in a folder
> To: [hidden email]
> Date: Friday, March 20, 2009, 2:33 PM
> Here is a modified python chunk I
> used last year sometime - to add 2000ish
> files
>
>
>
> BEGIN PROGRAM PYTHON.
>
> import os, sys, spss
> #help (spss)
>
> from spss import Submit
>
>
> ########################### VERSION 1
> ################################
>
>
> outpath = "I:\\Work\\Programs\\ConSPSSV1\\"
> #print outpath
> savext = ".sav"
> #print savext
>
>
> #Need variable to hold all sav filenames within 'outpath'
> directory
> SpssFilesT = os.listdir(outpath)
> SpssFiles = sorted(SpssFilesT)
> #print SpssFiles
>
>
> try:
>      Submit(r"""
>      GET FILE = '%s'.
>      EXECUTE.
>      """ %(outpath + SpssFiles[0]))
> except:
>     pass
>
> try:
>      #print SpssFiles[1:]
>      for addfle in SpssFiles[1:]:
>           Submit(r"""
>           ADD FILES FILE= *
>
>    /FILE= '%s'.
>           CACHE.
>           EXECUTE.
>           """ %(outpath +
> addfle))
> except:
>     pass
>
>
>
>
> END PROGRAM.
>
>
> ***** END PROGRAM BLOCK .
>
> SAVE OUTFILE=      "added files Raw.sav".
>
>
>
>
>
>
>
>
> ****************************
>
> Notice: This e-mail and any attachments may contain
> confidential and
> privileged information.  If you are not the intended
> recipient, please
> notify the sender immediately by return e-mail, do not use
> the information,
> delete this e-mail and destroy any copies.  Any
> dissemination or use of this
> information by a person other than the intended recipient
> is unauthorized
> and may be illegal.  Email transmissions cannot be
> guaranteed to be secure
> or error free. The sender therefore does not accept any
> liability for errors
> or omissions in the contents of this message that arise as
> a result of email
> transmissions.
>
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]]
> On Behalf Of
> Thien Hop
> Sent: March 20, 2009 8:59 AM
> To: [hidden email]
> Subject: Re: Adding files in a folder
>
> Thanks Dr Kendall and Albert a lot for your advices. They
> are all "*.sav"
> files. Normally I have less than 50 files at a time, if
> more than 50 files I
> will do it manually.
>
> All files have same key variable to match (serialnum).
>
> Thank you very much
>
> ----- Original Message -----
> From: "Art Kendall" <[hidden email]>
> To: "Thien Hop" <[hidden email]>
> Cc: <[hidden email]>
> Sent: Friday, March 20, 2009 8:01 PM
> Subject: Re: Adding files in a folder
>
>
> > if the files are text files and have a file identifier
> just use a HOST
> > command.
> > on windows something like.
> > host command = 'copy d:\project\raw\*.asc
> > d:\project\combined\combined.asc'.
> >
> > How are your data stored?  SPSS system files? csv
> files? etc. Does
> > each file have a variable that identifies the file?
> Perhaps each file
> > is for a city and city is a field in the files?
> >
> > How many files are you talking about?  (some
> procedures can only
> > handle 50 at a time.)
> >
> > Art Kendall
> > Social Research Consultants
> >
> > Thien Hop wrote:
> >> Hi all,
> >>
> >> I have to perform adding many files, many times to
> run consolidated
> >> analysis. Would much appreciate if any one could
> advise a macro (for
> >> version
> >> 12) to automatically do adding all files in a
> given folder.
> >>
> >> Thank you very much!
> >> ----- Original Message -----
> >> From: "Albert-Jan Roskam" <[hidden email]>
> >> To: <[hidden email]>
> >> Sent: Friday, March 20, 2009 4:51 PM
> >> Subject: www.wordsalad.eu
> >>
> >>
> >>> Hi all,
> >>>
> >>> I made a small web survey on poetry and I
> would really appreciate it
> >>> if you would participate. It only takes a few
> minutes and it is
> >>> entirely anonymous. You can find it on
> www.wordsalad.eu.
> >>>
> >>> To make this message a little less
> 'off-topic': I used Limesurvey to
> >>> create this survey. Limesurvey is freeware.
> It's very simple and it
> >>> works seamlessly with SPSS. It even allows you
> to generate a .dat
> >>> file and a .sps file with the needed GET DATA
> syntax + var labels.
> >>> It takes very little time to create a survey.
> The downside is that
> >>> making larger surveys may take an awful amount
> of mouse clicks. But
> >>> then again, in my humble opinion, very long
> surveys mostly measure
> >>> mental fatigue. ;-)
> >>>
> >>> Thank you in advance for your time, or in case
> you didn't want to
> >>> participate: sorry to have bothered you with
> this.
> >>>
> >>> Best wishes,
> >>> Albert-Jan
> >>>
> >>> =====================
> >>> To manage your subscription to SPSSX-L, send a
> message to
> >>> [hidden email]
> (not to SPSSX-L), with no body text except
> >>> the command. To leave the list, send the
> command SIGNOFF SPSSX-L For
> >>> a list of commands to manage subscriptions,
> send the command INFO
> >>> REFCARD
> >>
> >> =====================
> >> To manage your subscription to SPSSX-L, send a
> message to
> >> [hidden email]
> (not to SPSSX-L), with no body text except
> >> the command. To leave the list, send the command
> SIGNOFF SPSSX-L For
> >> a list of commands to manage subscriptions, send
> the command INFO
> >> REFCARD
> >>
> >>
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email]
> (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command SIGNOFF
> SPSSX-L For a list of
> commands to manage subscriptions, send the command INFO
> REFCARD
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email]
> (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the
> command
> INFO REFCARD
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD