<?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>topic Re: Cannot read text file. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366802#M703937</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion on my case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2012 08:26:26 GMT</pubDate>
    <dc:creator>Sokkorn</dc:creator>
    <dc:date>2012-05-24T08:26:26Z</dc:date>
    <item>
      <title>Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366801#M703936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear values visitors,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got an issue with (.dat) file. For each file store like this:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;{1=A&amp;nbsp;&amp;nbsp;&amp;nbsp; 2=B&amp;nbsp;&amp;nbsp;&amp;nbsp; 3=C}{1=X&amp;nbsp;&amp;nbsp;&amp;nbsp; 2=Y&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;3=Z}{1=N&amp;nbsp;&amp;nbsp;&amp;nbsp; 4=M&amp;nbsp;&amp;nbsp;&amp;nbsp; 5=O}{1=K&amp;nbsp;&amp;nbsp;&amp;nbsp; 6=P&amp;nbsp;&amp;nbsp;&amp;nbsp; 10=R}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;This is mean that one record seperate by {} and have no specific enter line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the result after QlikView read is like below:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;1=A&amp;nbsp;&amp;nbsp;&amp;nbsp; 2=B&amp;nbsp;&amp;nbsp;&amp;nbsp; 3=C&lt;/P&gt;&lt;P&gt;1=X&amp;nbsp;&amp;nbsp;&amp;nbsp; 2=Y&amp;nbsp;&amp;nbsp;&amp;nbsp; 3=Z&lt;/P&gt;&lt;P&gt;1=N&amp;nbsp;&amp;nbsp;&amp;nbsp; 4=M&amp;nbsp;&amp;nbsp;&amp;nbsp; 5=O&lt;/P&gt;&lt;P&gt;1=K&amp;nbsp;&amp;nbsp;&amp;nbsp; 6=P&amp;nbsp;&amp;nbsp;&amp;nbsp; 10=R&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very much appreciate for your idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enclosure: DATA.dat&amp;nbsp;&amp;nbsp;&amp;nbsp; (Open with Notepad to see content)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 06:47:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366801#M703936</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2012-05-24T06:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366802#M703937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion on my case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 08:26:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366802#M703937</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2012-05-24T08:26:26Z</dc:date>
    </item>
    <item>
      <title>Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366803#M703938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two solutions come to mind.&amp;nbsp; One would be to feed your .dat file through a vbs routine to read the data between the { and } characters line by line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second option is to loop through the rows in the load script and rebuild the data as necessary.&amp;nbsp; Something like this would work ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataRowTmp:&lt;BR /&gt;LOAD RecNo() as DataRecRef, @1 as Data&lt;BR /&gt;FROM&lt;BR /&gt;[DATA.dat]&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is \x7f, no quotes); // using a delimiter you know doesn't exist&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataRows: //Need to force the order of the table&lt;BR /&gt;NoConcatenate LOAD DataRecRef, Data&lt;BR /&gt;resident DataRowTmp order by DataRecRef;&lt;/P&gt;&lt;P&gt;DROP TABLE DataRowTmp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LET vRowBuilder = '';&lt;/P&gt;&lt;P&gt;For r = 1 to NoOfRows('DataRows')&lt;/P&gt;&lt;P&gt;LET vRow = peek('Data',$(r),'DataRows');&lt;/P&gt;&lt;P&gt;//let x = msgbox('$(vRow)'); //testing&lt;BR /&gt;If vRow = '}' then&lt;BR /&gt; &lt;BR /&gt; RealData:&lt;BR /&gt; LOAD '$(r)' as RecRef, '$(vRowBuilder)' as RealRow&lt;BR /&gt; resident DataRows;&lt;BR /&gt; &lt;BR /&gt; LET vRowBuilder = '';&lt;BR /&gt; &lt;BR /&gt;ELSE &lt;/P&gt;&lt;P&gt; LET vRowBuilder = '$(vRowBuilder)' &amp;amp; '&amp;nbsp;&amp;nbsp;&amp;nbsp; ' &amp;amp; '$(vRow)';&amp;nbsp; //not sure on tab ascii character needed&lt;BR /&gt; &lt;BR /&gt;ENDIF&lt;/P&gt;&lt;P&gt;Next;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will need some tweaking to make it work exactly but should give you a start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 08:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366803#M703938</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-05-24T08:37:54Z</dc:date>
    </item>
    <item>
      <title>Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366804#M703939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;just to understand.&lt;/P&gt;&lt;P&gt;Do you want a result table with a record like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp; X&amp;nbsp;&amp;nbsp;&amp;nbsp; Y&amp;nbsp;&amp;nbsp;&amp;nbsp; Z&amp;nbsp;&amp;nbsp;&amp;nbsp; N&amp;nbsp;&amp;nbsp;&amp;nbsp; M&amp;nbsp;&amp;nbsp;&amp;nbsp; O&amp;nbsp;&amp;nbsp;&amp;nbsp; K&amp;nbsp;&amp;nbsp;&amp;nbsp; P&amp;nbsp;&amp;nbsp;&amp;nbsp; R&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 08:41:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366804#M703939</guid>
      <dc:creator />
      <dc:date>2012-05-24T08:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366805#M703940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I understand it right, that's my proposal:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp_data:&lt;/P&gt;&lt;P&gt;LOAD rec, SubField(line, '=', 1) as field, SubField(line, '=', 2) as value;&lt;/P&gt;&lt;P&gt;LOAD if(RecNo()&amp;gt;1 and delim='', peek(rec), autonumber(if(delim='{', RecNo()))) as rec, line, delim;&lt;/P&gt;&lt;P&gt;LOAD trim(left(@1:n, 1)) as delim, @1:n as line&lt;/P&gt;&lt;P&gt;FROM DATA.dat&lt;/P&gt;&lt;P&gt;(fix, codepage is 1252);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;generic load * resident temp_data where field &amp;lt;&amp;gt; '{' and field &amp;lt;&amp;gt; '}';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----&lt;/P&gt;&lt;P&gt;There are also some examples here to consolidate the huge amount of tables of the generic load ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 08:53:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366805#M703940</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-05-24T08:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366806#M703941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thank for your prompt response. Let me test your solution after back to office.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 09:00:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366806#M703941</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2012-05-24T09:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366807#M703942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sokkorn,&lt;/P&gt;&lt;P&gt;Please find the attached file.&lt;/P&gt;&lt;P&gt;While it seems that it does give the desired results.&lt;/P&gt;&lt;P&gt;One strange thing I am seeing is that it is giving line breaks with every new data value, if I use any delimiter else than tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But anyways this seems to solve your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached file. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ashutosh Paliwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 09:39:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366807#M703942</guid>
      <dc:creator />
      <dc:date>2012-05-24T09:39:57Z</dc:date>
    </item>
    <item>
      <title>Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366808#M703943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution is awesome. Is it posible to merge all tables into one? So that I can easy to store data into one QVD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy: flipside: Your solution is working for small amount of data. Totally I have 10GB of data source. When apply your solution, then my pc getting stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy: giampiero: Not really. You can download Ralf's file to see data store.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy: Ashutosh: Your solution working find but pc performance used memory arount 680,000K while Ralf's solution use only 350,000K for 3 million records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, Ralf's solution is the best for me. But I still need your help to combine all those generic load into one table only. The reason is easy to store into QVD file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, still say many thanks for your kind support on my case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 10:16:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366808#M703943</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2012-05-24T10:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366809#M703944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Btw, I have extended the example with the table consolidation (adjusted from Rob Wunderlich's example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 10:49:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366809#M703944</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-05-24T10:49:21Z</dc:date>
    </item>
    <item>
      <title>Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366810#M703945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you see my second upload "data2.qvw" above? This is consolidated into one table at the end..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 19:02:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366810#M703945</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-05-24T19:02:04Z</dc:date>
    </item>
    <item>
      <title>Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366811#M703946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, my solution of looping over data might not be the best for large datasets!!&amp;nbsp; I did find later that the second table load (DataRows) was not needed to force the row order.&amp;nbsp; Taking that out and changing the original table name to DataRows would make it run faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 20:37:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366811#M703946</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-05-24T20:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366812#M703947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a slightly different approach to collapsing the "generic" tables.&amp;nbsp; With the current data I can't measure a LOAD time but included the calculation in the QVW for use when it's run against the entire dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 21:47:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366812#M703947</guid>
      <dc:creator />
      <dc:date>2012-05-24T21:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read text file.</title>
      <link>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366813#M703948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your solution. It working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy: Dave: I try your file with 3 million records and it spend around 3 minute. Actually I have data more than billion records. By the way your solution is good for me to get new idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again to all of you. You are my best friend &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sharing culture!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheer!!!!!!&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 01:01:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cannot-read-text-file/m-p/366813#M703948</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2012-05-25T01:01:47Z</dc:date>
    </item>
  </channel>
</rss>

