+ {
+ free (tok);
+ return parse_get_psql (lexer, ds);
+ }
+ else if (lex_match_id (lexer, "GNM") ||
+ lex_match_id (lexer, "ODS"))
+ {
+ char *filename = NULL;
+ if (!parse_spreadsheet (lexer, &filename, &opts))
+ goto error;
+
+ struct spreadsheet *spreadsheet = NULL;
+ if ( 0 == strncasecmp (tok, "GNM", 3))
+ spreadsheet = gnumeric_probe (filename, true);
+ else if ( 0 == strncasecmp (tok, "ODS", 3))
+ spreadsheet = ods_probe (filename, true);
+
+ if (spreadsheet == NULL)
+ {
+ msg (SE, _("error reading file `%s'"), filename);
+ free (filename);
+ goto error;
+ }
+ free (filename);
+
+ struct casereader *reader = spreadsheet_make_reader (spreadsheet, &opts);
+ if (reader)
+ {
+ dataset_set_dict (ds, dict_clone (spreadsheet->dict));
+ dataset_set_source (ds, reader);
+ free (tok);
+ destroy_spreadsheet_read_info (&opts);
+ spreadsheet_unref (spreadsheet);
+ return CMD_SUCCESS;
+ }
+ spreadsheet_unref (spreadsheet);
+ }
+ else
+ msg (SE, _("Unsupported TYPE %s."), tok);
+