[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GET DATA DELIMITED TEXT
From: |
John Darrington |
Subject: |
Re: GET DATA DELIMITED TEXT |
Date: |
Sat, 18 Jul 2015 12:38:32 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sat, Jul 18, 2015 at 11:57:20AM +0200, Frans Houweling wrote:
On 18/07/2015 10:04, John Darrington wrote:
Thanks for the hint, John. My problem with that (and the same
goes for SPSS & Excel) is that you have no control of string
lengths: combining 2 .savs from similar spreadsheets is a
nightmare (unless I miss something). Please allow me to take
advantage of the occasion to repeat the request that PSPP get rid
of the same-string-length rigidity.
It is true that ADD FILES requires string variables to have the same width.
Perhaps that could be relaxed in the future.
But I don't see that this is a big problem, unless you are dealing with huge
data files. Since it is trivial to add a new variable of the appropriate
length and copy the values in.
Try this for example:
data list list /s1(a30).
begin data.
"This is a long string"
"so is this one!!!!!"
end data.
save outfile='long-string.sav'.
new file.
data list list /s2(a5).
begin data.
short
vshrt
xxxx
end data.
save outfile='short-string.sav'.
NEW FILE.
GET FILE='short-string.sav'.
STRING ss(a30).
COMPUTE ss=s2.
DELETE VARIABLE s2.
ADD FILES
/FILE=*
/FILE='long-string.sav'
/RENAME=(s1=ss)
.
LIST.
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
signature.asc
Description: Digital signature