Add copyright and licence notices to files which lack them.
[pspp] / tests / language / data-io / save.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl 
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl 
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl AT_BANNER([IMPORT and EXPORT])
17
18 AT_SETUP([IMPORT and EXPORT])
19 AT_DATA([import-export.sps], [dnl
20 DATA LIST LIST NOTABLE /X Y.
21 BEGIN DATA.
22 1 2
23 3 .
24 5 6
25 END DATA.
26
27 EXPORT /OUTFILE='wiz.por'.
28 IMPORT /FILE='wiz.por'.
29
30 LIST.
31 ])
32 AT_CHECK([pspp -o pspp.csv import-export.sps])
33 AT_CHECK([cat pspp.csv], [0], [dnl
34 Table: Data List
35 X,Y
36 1.00,2.00
37 3.00,.  @&t@
38 5.00,6.00
39 ])
40 AT_CLEANUP
41
42 AT_BANNER([SAVE])
43
44 # UNSELECTED=DELETE used to cause a crash if there was actually a
45 # filter variable.
46 AT_SETUP([SAVE -- delete unselected])
47 AT_DATA([data.txt], [dnl
48 0 '1 9:30:05' 1/2/2003 "25/8/1995 15:30:00" "'a,b,c'",0
49 , '-0 5:17' 10/31/2010 "9/4/2008 9:29:00" " xxx ",1
50 1.625,'0 12:00',,,xyzzy,1
51 ])
52 AT_DATA([save.pspp], [dnl
53 SET DECIMAL=DOT.
54 DATA LIST LIST NOTABLE FILE="data.txt"
55     /number(F8.3) time(DTIME10) date(ADATE10) datetime(DATETIME20) string(A8)
56      filter(F1.0).
57 MISSING VALUES number(0) time('0 12:00') string('xyzzy').
58 FILTER BY filter.
59 SAVE /OUTFILE="data.sav" /UNSELECTED=DELETE.
60 ])
61 AT_DATA([get.pspp], [dnl
62 GET FILE='data.sav'.
63 LIST.
64 ])
65 AT_CHECK([pspp -O format=csv save.pspp])
66 AT_CHECK([pspp -O format=csv get.pspp], [0], [dnl
67 Table: Data List
68 number,time,date,datetime,string,filter
69 .   ,-0 05:17,10/31/2010,09-APR-2008 09:29:00,xxx    ,1
70 1.625,0 12:00:00,.,.,xyzzy   ,1
71 ])
72 AT_CLEANUP