how I can import a large amount of csv files

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

how I can import a large amount of csv files

Javier Meneses
how I can import a large amount of csv files with the same variable structure with a command  do if or macro. ?
  In stata I can do it with command - local and foreach!-

        Thank
Reply | Threaded
Open this post in threaded view
|

Re: how I can import a large amount of csv files

Art Kendall
open a new instance of SPSS paste the line below into a syntax window, run it.
spssinc process files /help.

If the csv files do not have a line with the variable names and if (you have a variable in the file OR it makes no difference which source file cases come from),
use your OS to copy all the files into one file
in Windows copy all the files into a folder e.g. c:\many\
Create a new folder e.g., c:\allin1\
open a command window
enter  commands something like this
cd c:
copy c:\many\*.csv c:\allin1\big.csv

Art Kendall
Social Research Consultants
On 10/15/2013 3:30 PM, Javier Meneses [via SPSSX Discussion] wrote:
how I can import a large amount of csv files with the same variable structure with a command  do if or macro. ?
  In stata I can do it with command - local and foreach!-

        Thank



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/how-I-can-import-a-large-amount-of-csv-files-tp5722566.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: how I can import a large amount of csv files

Bruce Weaver
Administrator
You can use Art's DOS COPY method even if the files do have variable names in the first row:  After merging all of the files via COPY, open with Excel, sort to get all the rows with variable names next to each other, delete all but one of those rows, and then save the modified file.

HTH.


Art Kendall wrote
open a new instance of
        SPSS paste the line below into a syntax window, run it.
      spssinc process files /help.
       
        If the csv files do not have a line with the variable names and
        if (you have a variable in the file OR it makes no difference
        which source file cases come from),
        use your OS to copy all the files into one file
        in Windows copy all the files into a folder e.g. c:\many\
        Create a new folder e.g., c:\allin1\
        open a command window
        enter  commands something like this
        cd c:
        copy c:\many\*.csv c:\allin1\big.csv
       
     
      Art Kendall
Social Research Consultants
      On 10/15/2013 3:30 PM, Javier Meneses [via SPSSX Discussion]
      wrote:
   
   
     
      how I can import a large amount of csv files with the
        same variable structure with a command  do if or macro. ?
        In stata I can do it with command - local and
        foreach!-
     
     
              Thank
     
     
     
     
        If you reply to this email, your
          message will be added to the discussion below:
        http://spssx-discussion.1045642.n5.nabble.com/how-I-can-import-a-large-amount-of-csv-files-tp5722566.html 
     
     
        To start a new topic under SPSSX Discussion, email
        [hidden email] 
        To unsubscribe from SPSSX Discussion, click
          here .
        NAML
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).