You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+11-5
Original file line number
Diff line number
Diff line change
@@ -17,25 +17,29 @@ in a DuckDB instance near you.
17
17
The extension adds a single DuckDB table function, `read_stat`, which you use as follows:
18
18
19
19
```SQL
20
-
-- Read a SAS `.sas7bdat` file
20
+
-- Read a SAS `.sas7bdat` or `.xpt` file
21
21
FROM read_stat('sas_data.sas7bdat');
22
-
-- Read an SPSS `.sav` or `.zsav` file
22
+
FROM read_stat('sas_data.xpt');
23
+
-- Read an SPSS `.sav`, `.zsav`, or `.por` file
23
24
FROM read_stat('spss_data.sav');
24
25
FROM read_stat('compressed_spss_data.zsav');
26
+
FROM read_stat('portable_spss_data.por');
25
27
-- Read a Stata .dta file
26
28
FROM read_stat('stata_data.dta');
27
29
```
28
30
29
-
If the file extension is not `.sas7bdat`, `.sav`, `.zsav`, or `.dta`,
31
+
If the file extension is not `.sas7bdat`, `.xpt`, `.sav`, `.zsav`, `.por`, or `.dta`,
30
32
use the `read_stat` function for the right file type with the `format` parameter:
31
33
32
34
```SQL
33
35
FROM read_stat('sas_data.other_extension', format ='sas7bdat');
36
+
FROM read_stat('sas_data.other_extension', format ='xpt');
34
37
-- SPSS `.sav` and `.zsav` can both be read through the format `'sav'`
35
38
FROM read_stat(
36
39
'spss_data_possibly_compressed.other_extension',
37
40
format ='sav'
38
41
);
42
+
FROM read_stat('portable_spss_data.other_extension', format ='por');
39
43
FROM read_stat('stata_data.other_extension', format ='dta');
40
44
```
41
45
@@ -48,11 +52,13 @@ FROM read_stat('latin1_encoded.sas7bdat', encoding = 'iso-8859-1');
48
52
If your files have the proper file extensions and you do not need to override their character encodings, a [replacement scan](<https://duckdb.org/docs/stable/guides/glossary.html#replacement-scan>) is also available:
0 commit comments