From 965d82cdc50d81c07b736a0f92c680fdb010c976 Mon Sep 17 00:00:00 2001 From: pjk Date: Thu, 13 May 2004 18:31:13 +0000 Subject: [PATCH] Adjusted code for DATA LIST (free/list) to be more consistent with SPSS in the instance where delimiters are explicitly set. In particular, if a delim. is explicitly set, we treat quotes / apostrophes as normal chars: MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit From SPSS Syntax Base manual: For data with explicitly specified value delimiters (for example, DATA LIST FREE (","): · Multiple delimiters without any intervening space can be used to specify missing data. · The specified delimiters cannot occur within a data value, even if you enclose the value in quotation marks or apostrophes. --- src/data-list.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/data-list.c b/src/data-list.c index a80fff3075..62734de1d1 100644 --- a/src/data-list.c +++ b/src/data-list.c @@ -970,7 +970,16 @@ cut_field (const struct data_list_pgm *dls, char **ret_cp, int *ret_len) return 0; /* Three types of fields: quoted with ', quoted with ", unquoted. */ - if (*cp == '\'' || *cp == '"') + /* Quoting does not escape the effects of delimiters for explicitly */ + /* specified delims */ + /* (consistency with SPSS doco: */ + /* For data with explicitly specified value delimiters (for example, */ + /* DATA LIST FREE (","): */ + /* - Multiple delimiters without any intervening space can be used */ + /* to specify missing data. */ + /* - The specified delimiters cannot occur within a data value, even */ + /* if you enclose the value in quotation marks or apostrophes. */ + if (dls->delim==0 && (*cp == '\'' || *cp == '"')) { int quote = *cp; -- 2.30.2