pspp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Importing Data


From: ftr public
Subject: Re: Importing Data
Date: Sat, 27 Jan 2018 19:36:53 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

Hi Tara,

I guess you use the GUI. If you look into the manual and look how to import csv or ods files you avoid this error.

Look for the GET DATA command:

9.4.3 Textual Data Files

GET DATA /TYPE=TXT
        /FILE={’file_name’,file_handle}
        [ENCODING=’encoding’]
        [/ARRANGEMENT={DELIMITED,FIXED}]
        [/FIRSTCASE={first_case}]
        [/IMPORTCASES=...]
        …additional subcommands depending on ARRANGEMENT…

When TYPE=TXT is specified, GET DATA reads data in a delimited or fixed columnar format, much like DATA LIST (see DATA LIST).

The FILE subcommand is mandatory. Specify the file to be read as a string file name or (for textual data only) a file handle (see File Handles).

The ENCODING subcommand specifies the character encoding of the file to be read. See INSERT, for information on supported encodings.

The ARRANGEMENT subcommand determines the file’s basic format. DELIMITED, the default setting, specifies that fields in the input data are separated by spaces, tabs, or other user-specified delimiters. FIXED specifies that fields in the input data appear at particular fixed column positions within records of a case.

By default, cases are read from the input file starting from the first line. To skip lines at the beginning of an input file, set FIRSTCASE to the number of the first line to read: 2 to skip the first line, 3 to skip the first two lines, and so on.

IMPORTCASES is ignored, for compatibility. Use N OF CASES to limit the number of cases read from a file (see N OF CASES), or SAMPLE to obtain a random sample of cases (see SAMPLE).

The remaining subcommands apply only to one of the two file arrangements, described below.

HTH

- ftr


On 27/01/2018 16:32, Tara McCoy wrote:
Hi - when I try importing a .csv file into PSPP it does not give me the option to indicate that the first row of data includes the variable names. It also does not automatically import them as names. I have uninstalled and re-installed PSPP multiple times while also creating different .csv files but the variable names still do not appear.

I then tried to import using a .ods (LibreOffice). I was able to get the titles in (as the checkbox for this appeared); however, some of my variables in only the first row of select columns are identified as string variables and removed from just the first row upon importing. I have checked - rechecked the format properties of these cells to ensure they are numeric, but the same issue for the same columns continues to occur.

I'm at a bit of a loss for what to do next. Any suggestions are much appreciated!

--
Tara McCoy, PhD
Personality and Identity Lab
Department of Psychology
University of California, Riverside
900 University Avenue
Riverside, CA 92521


 


_______________________________________________
Pspp-users mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/pspp-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]