<div dir="ltr"><div><div><div><div><div>Dear Samuel, Rafael,<br><br></div>thanks for taking my initial question further to a higher level.<br><br></div>I wouldn't have expected to create a bug out of it.<br><br></div>So, for me:<br><br> I am fine with either creating a temporary file and using fscanfMat or mfscanf().<br><br></div><div>In fact:<br><br></div><div>fscanfMat() is closer to my level of code understanding, since I get a m-x-n matrix as a result<br><br></div><div>with mfscanf() I get an mlist.<br></div><div><br></div>Thanks a lot,<br></div>Philipp<br><div><div><div><br><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-10-15 23:40 GMT+02:00 Samuel Gougeon <span dir="ltr"><<a href="mailto:sgougeon@free.fr" target="_blank">sgougeon@free.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
    <div class="m_8032291226762831898moz-cite-prefix">Le 15/10/2016 21:16, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote type="cite">
      
      <div class="m_8032291226762831898moz-cite-prefix">Hello Philipp,<br>
        <br>
        Le 14/10/2016 00:08, Philipp Mühlmann a écrit :<br>
      </div>
      <blockquote type="cite">
        <div dir="ltr">
          <div>
            <div>
              <div>Dear Scilab users,<br>
                <br>
              </div>
              having a data file (*.cvs) containg following format:<br>
              <br>
              <br>
            </div>
            HEADER-Line<br>
          </div>
          dd.mm.yyyy, HH:MM:<a href="http://SS.MS" target="_blank">SS.MS</a>, value01, value02<br>
          <br clear="all">
          <div>
            <div>
              <div>
                <div>
                  <div>dd = day<br>
                  </div>
                  <div>mm = month<br>
                  </div>
                  <div>yyyy = year<br>
                    <br>
                  </div>
                  <div>HH = hour<br>
                  </div>
                  <div>MM = minute<br>
                  </div>
                  <div>SS = second<br>
                  </div>
                  <div>Ms = milli second<br>
                    <br>
                  </div>
                  <div>ValueXY = numerical value<br>
                  </div>
                  <div><br>
                  </div>
                  <div>Is it possible to use cvsRead in such a way to
                    define the separator beeing ',' and ':' at the same
                    time?<br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </blockquote>
      .<br>
      Yes and no: Yes because each character of the "separator" option
      is (sometimes) considered as a<br>
      separator. And no, because it sometimes fails.<br>
      I was designing an example to add to the csvRead() page, when a
      found this bug:<br>
      <br>
      <tt>--> mputl("12.08.2016, 13:54:18.45, 3.145, 548.4",
        TMPDIR+"/test.csv")</tt><tt><br>
        <br>
      </tt><tt>--> r = "''"+csvRead("test.csv","8.",[<wbr>],"string")+"''"</tt><tt><br>
      </tt><tt> r  = </tt><tt><br>
      </tt><tt>!'12'  '0'  '2016, 13:54:1'  '45, 3'  '145, 54'  '4'  !</tt><tt><br>
      </tt><tt>--> // it works: both "8" and "." are <b>separately</b>
        considered as separators<br>
        <br>
        --> // now trying with "," and ":":</tt><br>
      <tt>--> r = "''"+csvRead("test.csv",",:", [], "string")+"''"</tt><tt><br>
      </tt><tt>--> r = "''"+csvRead("test.csv",",:", [],
        "string")+"''"<br>
         r  = <br>
         '12.08.2016, 13:54:18.45, 3.145, 548.4'<br>
        --> // The row is kept as is: no splitting!<br>
        --> // We could expect: [</tt><tt><tt>'12.08.2016' ' 13' '54'
          '18.45' ' 3.145' ' 548.4']<br>
          --> //  (with leading spaces, since they are not set as
          separators)<br>
          --> </tt></tt><br>
      <br>
      There are already 10 pending reported bugs about csvRead(). One
      more.<br>
    </blockquote></div></div>
    Report : <a class="m_8032291226762831898moz-txt-link-freetext" href="http://bugzilla.scilab.org/14809" target="_blank">http://bugzilla.scilab.org/<wbr>14809</a><br>
    <br>
    Each char of a separator with length > 1 is considered a specific
    separator only if the whole separator pattern is met in the read
    row. Otherwise, no splitting is done. Hence<tt>,<br>
    </tt><tt>--> r = csvRead(TMPDIR+"test.csv","8."<wbr>,[],"string") //
      splits the </tt><tt><tt>"12.08.2016"</tt> row, while<br>
      --></tt><tt><tt> r =
        csvRead(TMPDIR+"test.csv",".8"<wbr>,[],"string") // does not!<span class="HOEnZb"><font color="#888888"><br>
      </font></span></tt></tt><span class="HOEnZb"><font color="#888888"><br>
    Samuel Gougeon<br>
    <br>
  </font></span></div>

<br>______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/<wbr>mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.</div><div><br></div><div>There we have the salad.</div></div></div>
</div>