help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Empty fields in CSV files


From: glpk xypron
Subject: [Help-glpk] Empty fields in CSV files
Date: Wed, 03 Nov 2010 21:37:43 +0100

Dear Andrew,

if a CSV file contains a string of length zero, glpsol returns
an error when reading the file. It is unclear why this
restriction was implemented.

E.g.

C1,C2,C3
abc,,1
abc,1,""

RFC 4180 does not forbid strings of length zero, see
http://tools.ietf.org/rfc/rfc4180.txt

GLPK can handle strings of length zero as shown by the following
example:

param a, symbolic := '';
printf "len(a) = %d\n", length(a);
end;

The coding in question is in glpmpl06.c:

         if (csv->c == ',')
err1:    {  xprintf("%s:%d: empty field not allowed\n", csv->fname,
               csv->count);
            longjmp(csv->jump, 0);
         }
...
         /* the field has been read */
         if (len == 0) goto err1;

I suggest to lift the restriction.

Best regards

Xypron
-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail



reply via email to

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