bug-glpk
[Top][All Lists]
Advanced

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

Re: [Bug-glpk] CSV: empty field not allowed


From: Heinrich Schuchardt
Subject: Re: [Bug-glpk] CSV: empty field not allowed
Date: Wed, 8 Jun 2016 16:58:37 +0200

Dear Andrew,

please remove the following lines in function read_field of src/mpl/mpl6.c to 
fix the issue:

line 121-130
         if (csv->c == ',')
err1:    {  xprintf("%s:%d: empty field not allowed\n", csv->fname,
               csv->count);
            longjmp(csv->jump, 0);
         }
         if (csv->c == '\n')
         {  xprintf("%s:%d: empty record not allowed\n", csv->fname,
               csv->count);
            longjmp(csv->jump, 0);
         }

line 182:
         if (len == 0) goto err1;

Best regards

Heinrich Schuchardt

> Gesendet: Mittwoch, 08. Juni 2016 um 11:01 Uhr
> Von: address@hidden
> An: "Bug Glpk" <address@hidden>
> Cc: address@hidden
> Betreff: [Bug-glpk] CSV: empty field not allowed
>
> Hello Andrew,
> 
> I have file Q.csv:
> 
> C:\Temp>type Q
> i,j,k,Q
> 1,1,1,""
> 1,1,2,1 3 4 5
> 1,1,3,1 5
> 1,1,4,1 3 5
> 
> and model test.mod
> 
> set I, dimen 3;
> set J;
> param Q{I}, symbolic;
> table data IN "CSV" "Q.csv" :
>   I <- [i, j, k], Q;
> solve;
> display Q;
> end;
> 
> I get unexpected error:
> Q.csv:2: empty field not allowed
> 
> Why shouldn't Q[1,1,1] be read as a string of length 0?
> 
> This relates to the question by Krishna.
> 
> Best regards
> 
> Heinrich Schuchardt



reply via email to

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