<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis Microcontrollers中的主题 Re: Reading txt file on k60 MQX</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183862#M1883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At this moment I use this code and it's ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;char RIGA[100];&lt;/P&gt;&lt;P&gt;char *str1;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;fscanf(fp,"%s",RIGA);//read all row&lt;BR /&gt;fgetc(fp);&lt;BR /&gt;str1 = strtok(RIGA, " ");&lt;BR /&gt;strcpy(prec.marca,str1);&lt;BR /&gt;str1 = strtok(NULL, " ");&lt;BR /&gt;strcpy(prec.modello,str1);&lt;BR /&gt;str1 = strtok(NULL, " ");&lt;BR /&gt;strcpy(prec.dettaglio,str1);&lt;BR /&gt;str1 = strtok(NULL, " ");&lt;BR /&gt;strcpy(prec.gas,str1);&lt;BR /&gt;str1 = strtok(NULL, "\n");&lt;BR /&gt;strcpy(prec.olio,str1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing better than this...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2011 19:24:02 GMT</pubDate>
    <dc:creator>Curro</dc:creator>
    <dc:date>2011-11-18T19:24:02Z</dc:date>
    <item>
      <title>Reading txt file on k60 MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183860#M1881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to run a code on k60 with MQX 3.6.2.&lt;/P&gt;&lt;P&gt;The code is tested on PC and everything is ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;char dbver[20];&lt;BR /&gt;char marca[20];&lt;BR /&gt;char modello[20];&lt;BR /&gt;char dettaglio[20];&lt;BR /&gt;uint_32 gas;&lt;BR /&gt;char olio[10];&lt;BR /&gt;} DB_DATA;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;FILE *fp;&lt;/P&gt;&lt;P&gt;DB_DATA prec,;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;fp=fopen("a:/file.txt","r");&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;fscanf(fp,"%s%s%s%i%s",prec.marca,prec.modello,prec.dettaglio,&amp;amp;prec.gas,prec.olio);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Txt file is composed by rows so made:&lt;/P&gt;&lt;P&gt;name1 name2 name3 500 name4&lt;/P&gt;&lt;P&gt;with spaces (I tried even with tabs) between names/number.&lt;/P&gt;&lt;P&gt;In&amp;nbsp;prec.marca I find all the line and program (of course...) goes in error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Someone can help me?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 21:52:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183860#M1881</guid>
      <dc:creator>Curro</dc:creator>
      <dc:date>2011-11-17T21:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading txt file on k60 MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183861#M1882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried even with this instruction&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fread(&amp;amp;prec,sizeof(DB_DATA),1,fp)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I get the same problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 22:43:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183861#M1882</guid>
      <dc:creator>Curro</dc:creator>
      <dc:date>2011-11-17T22:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reading txt file on k60 MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183862#M1883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At this moment I use this code and it's ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;char RIGA[100];&lt;/P&gt;&lt;P&gt;char *str1;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;fscanf(fp,"%s",RIGA);//read all row&lt;BR /&gt;fgetc(fp);&lt;BR /&gt;str1 = strtok(RIGA, " ");&lt;BR /&gt;strcpy(prec.marca,str1);&lt;BR /&gt;str1 = strtok(NULL, " ");&lt;BR /&gt;strcpy(prec.modello,str1);&lt;BR /&gt;str1 = strtok(NULL, " ");&lt;BR /&gt;strcpy(prec.dettaglio,str1);&lt;BR /&gt;str1 = strtok(NULL, " ");&lt;BR /&gt;strcpy(prec.gas,str1);&lt;BR /&gt;str1 = strtok(NULL, "\n");&lt;BR /&gt;strcpy(prec.olio,str1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing better than this...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 19:24:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183862#M1883</guid>
      <dc:creator>Curro</dc:creator>
      <dc:date>2011-11-18T19:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading txt file on k60 MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183863#M1884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I typically use:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; fread( fileBuff, sizeof(U16), 1, filePtr );&lt;/P&gt;&lt;P&gt;without problem.&lt;/P&gt;&lt;P&gt;I could not understand what kind of problem are you having with fread?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 00:10:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Reading-txt-file-on-k60-MQX/m-p/183863#M1884</guid>
      <dc:creator>michele_novalia</dc:creator>
      <dc:date>2011-11-24T00:10:18Z</dc:date>
    </item>
  </channel>
</rss>

