pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestions


From: John Darrington
Subject: Re: Suggestions
Date: Thu, 29 Jan 2009 11:56:40 +0900
User-agent: Mutt/1.5.13 (2006-08-11)

I think your change to data-in.c is probably ok, but I'll let Ben
comment on it as it's his code.

Regarding the length of value labels: removing the 60 byte limit will
cause problems when it comes to writing the data to a .sav file.
Whilst recent spss versions can read/write value labels of any length,
it does so by using a special extension to the file format.

There's no fundamental reason why pspp can't also support arbitrary
length labels, but since one of the goals of pspp is to be compatible
with spss, before it's done, we would need to support these extensions
too.  If  you're interested in doing this work, this will require a
little bit of reverse engineering upon existing spss .sav files to
discover how very long value labels are encoded
(test/dissect-sysfile.c  might help you) and add the appropriate code
to src/data/sys-file-writer.c and src/data/sys-file-reader.c 

Thanks for your feedback.

J'


On Wed, Jan 28, 2009 at 12:07:42PM +0100, Rémi Dewitte wrote:
     Hello,
     
     Working with pspp-0.6.1 I am glad it works fine. Nevertheless I encountered
     two minor issues for which I have patched a bit pspp.
     
     First one is the ability to import CSV file with DOS endlines. I don't know
     whether it is the right place to trim the '\r'.
     
     Second one is the ability to have long value labels. Is it an old 
limitation
     which could be removed ?
     
     What do you think ?
     
     diff -r -c pspp-0.6.1/src/data/data-in.c pspp-0.6.1.patched/src/data/
     data-in.c
     *** pspp-0.6.1/src/data/data-in.c       2008-06-09 06:37:38.000000000
     +0200
     --- pspp-0.6.1.patched/src/data/data-in.c       2009-01-28
     12:00:00.000000000
     +0100
     ***************
     *** 1232,1238
     ****
       static
     bool
       trim_spaces_and_check_missing (struct data_in
     *i)
     
     {
     !   ss_trim (&i->input, ss_cstr ("
     "));
         if (ss_is_empty (i->input) || ss_equals (i->input, ss_cstr
     (".")))
     
     {
             default_result
     (i);
     --- 1232,1238
     ----
       static
     bool
       trim_spaces_and_check_missing (struct data_in
     *i)
     
     {
     !   ss_trim (&i->input, ss_cstr ("
     \r"));
         if (ss_is_empty (i->input) || ss_equals (i->input, ss_cstr
     (".")))
     
     {
             default_result
     (i);
     
     diff -r -c pspp-0.6.1/src/language/dictionary/value-labels.c
     pspp-0.6.1.patched/src/language/dictionary/value-labels.c
     *** pspp-0.6.1/src/language/dictionary/value-labels.c   2008-06-09
     06:37:38.000000000
     +0200
     --- pspp-0.6.1.patched/src/language/dictionary/value-labels.c   2009-01-20
     12:49:34.000000000
     +0100
     ***************
     *** 181,188 ****
     
             if (ds_length (&label) > 60)
             {
     !         msg (SW, _("Truncating value label to 60 characters."));
     !         ds_truncate (&label, 60);
             }
     
             for (i = 0; i < var_cnt; i++)
     --- 181,188 ----
     
             if (ds_length (&label) > 60)
             {
     !         msg (SW, _("Truncating value label to 60 characters. (Not doing 
it
     will fail ???)"));
     !         //ds_truncate (&label, 60);
             }
     
             for (i = 0; i < var_cnt; i++)
     
     Rémi

     _______________________________________________
     pspp-dev mailing list
     address@hidden
     http://lists.gnu.org/mailman/listinfo/pspp-dev


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]