<?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: File Code Issues in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546553#M598730</link>
    <description>&lt;P&gt;I handle multiple files with different encodings in the Script Log Analyzer tool. You can take a look at the script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Qlikview Cookbook: Script Log Analyzer &lt;A href="http://qlikviewcookbook.com/recipes/download-info/script-log-analyzer/" target="_blank"&gt;http://qlikviewcookbook.com/recipes/download-info/script-log-analyzer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The script bit that determines the encoding looks like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;FOR EACH vEncoding IN 'utf8', 'unicode', 'codepage is 1252';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; TempCode:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; FIRST 1 // Log first row&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; LOAD IsNum(left(@1:n,1)) as X // Test first char. Set to true if it's a number.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; FROM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; [$(_logpath)]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; (fix, $(vEncoding))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; WHERE RecNo()&amp;gt;1 // Skip rec 1, which causes problems if it has a BOM (Byte Order Marker)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; EXIT FOR WHEN peek('X'); // If a number, assume we have the right encoding.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NEXT vEncoding;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DROP TABLE TempCode;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and then $(vEncoding) is used in the LOAD statement.&amp;nbsp; You may have to adjust the "IsNum(" test for your data. I know I'm looking for a number in that position, you may have to look at something specific to your data.&amp;nbsp; If it's something you can recognize, then you have the right codepage for that file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Rob&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 19:33:02 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2019-02-19T19:33:02Z</dc:date>
    <item>
      <title>File Code Issues</title>
      <link>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546504#M598727</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am experiencing an issue trying to read a file from a third party into QV. The original file was able to be read in with&amp;nbsp;&lt;EM&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/EM&gt; but at some point the file format was changed and can only be read with&amp;nbsp;&lt;EM&gt;(txt, unicode, embedded labels, delimiter is ',', msq); . &lt;/EM&gt;I am now trying to test some historical data and&amp;nbsp; cannot read both type of files at the same time. I have always read it using a loop so to load both files using different Character Sets. Is there a way to solution this issue? Any help with this matter is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546504#M598727</guid>
      <dc:creator>ecrobles18</dc:creator>
      <dc:date>2024-11-16T21:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: File Code Issues</title>
      <link>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546542#M598728</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49091"&gt;@ecrobles18&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the suggestion Rob posted in this thread.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Management/Load-Log-File-Encoding/m-p/884711?advanced=false&amp;amp;collapse_discussion=true&amp;amp;q=test%20codepage%20unicode&amp;amp;search_type=thread" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/QlikView-Management/Load-Log-File-Encoding/m-p/884711?advanced=false&amp;amp;collapse_discussion=true&amp;amp;q=test%20codepage%20unicode&amp;amp;search_type=thread&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-03 lia-quilt-column-left lia-quilt-column-side-content"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-message-author-avatar lia-component-author-avatar lia-component-message-view-widget-author-avatar"&gt;&lt;DIV class="UserAvatar lia-user-avatar"&gt;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148" target="_self"&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/avatars/a1232_4TC9C54RS92Y.jpg" border="0" alt="rwunderlich" title="rwunderlich" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-21 lia-quilt-column-right lia-quilt-column-main-content"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;&lt;DIV class="lia-message-author-with-avatar"&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-MVP lia-component-message-view-widget-author-username"&gt;&lt;IMG src="https://community.qlik.com/html/rank_icons/Community-MVP-Green-72x7.png" border="0" alt="MVP" title="MVP" /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6148" target="_self"&gt;&lt;SPAN class="login-bold"&gt;Rwunderlich&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class="lia-message-author-rank lia-component-author-rank lia-component-message-view-widget-author-rank"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;MVP&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-post-date lia-component-post-date lia-component-message-view-widget-post-date"&gt;&lt;SPAN class="DateTime"&gt;&lt;SPAN class="local-date"&gt;‎07-16-2015&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt;12:00 AM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-menu-navigation-wrapper lia-menu-action lia-component-message-view-widget-action-menu"&gt;&lt;DIV class="lia-menu-navigation"&gt;&lt;DIV class="dropdown-default-item"&gt;&lt;DIV class="dropdown-positioning"&gt;&lt;DIV class="dropdown-positioning-static"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="topic-subject-wrapper"&gt;&lt;DIV class="lia-message-subject lia-component-message-view-widget-subject"&gt;&lt;DIV class="MessageSubject"&gt;&lt;DIV class="MessageSubjectIcons "&gt;&lt;DIV class="lia-message-subject"&gt;Re: Load Log File Encoding&lt;/DIV&gt;&lt;SPAN class="lia-message-unread"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;I deal with the same problem in my Script Log Analyzer tool. You can download the tool and see how I handle it in the script (see tab "Initial Logdata Load"):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Qlikview Cookbook: Script Log Analyzer&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://qlikviewcookbook.com/recipes/download-info/script-log-analyzer/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://qlikviewcookbook.com/recipes/download-info/script-log-analyzer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;What I do is test the first character of the logfile with various encodings to see if I can interpret it as a number. When I get a positive I use that encoding to read the file. Probably would break if someone used a MMM-DD-YYYY format, but haven't had a complaint (yet). Here's the relevant code that determines the encoding.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;FOR EACH vEncoding IN 'utf8', 'unicode', 'codepage is 1252';

  TempCode:

  FIRST 1 // Log first row

  LOAD IsNum(left(@1:n,1)) as X // Test first char. Set to true if it's a number.

  FROM

  [$(_logpath)]

  (fix, $(vEncoding))

  ;

  EXIT FOR WHEN peek('X'); // If a number, assume we have the right encoding.

NEXT vEncoding;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 18:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546542#M598728</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2019-02-19T18:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: File Code Issues</title>
      <link>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546544#M598729</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49091"&gt;@ecrobles18&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see Rob Wunderlich's post in this thread&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Management/Load-Log-File-Encoding/m-p/884711?collapse_discussion=true&amp;amp;q=unicode%20codepage%20log&amp;amp;search_type=thread" target="_blank"&gt;https://community.qlik.com/t5/QlikView-Management/Load-Log-File-Encoding/m-p/884711?collapse_discussion=true&amp;amp;q=unicode%20codepage%20log&amp;amp;search_type=thread&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"What I do is test the first character of the logfile with various encodings&amp;nbsp; to see if I can interpret it as a number. When I get a positive I use that encoding to read the file. Probably would break if someone used a MMM-DD-YYYY format, but haven't had a complaint (yet). Here's the relevant code that determines the encoding."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;FOR EACH vEncoding IN 'utf8', 'unicode', 'codepage is 1252';

  TempCode:

  FIRST 1 // Log first row

  LOAD IsNum(left(@1:n,1)) as X // Test first char. Set to true if it's a number.

  FROM

  [$(_logpath)]

  (fix, $(vEncoding))

  ;

  EXIT FOR WHEN peek('X'); // If a number, assume we have the right encoding.

NEXT vEncoding;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:01:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546544#M598729</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2019-02-19T19:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: File Code Issues</title>
      <link>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546553#M598730</link>
      <description>&lt;P&gt;I handle multiple files with different encodings in the Script Log Analyzer tool. You can take a look at the script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Qlikview Cookbook: Script Log Analyzer &lt;A href="http://qlikviewcookbook.com/recipes/download-info/script-log-analyzer/" target="_blank"&gt;http://qlikviewcookbook.com/recipes/download-info/script-log-analyzer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The script bit that determines the encoding looks like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;FOR EACH vEncoding IN 'utf8', 'unicode', 'codepage is 1252';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; TempCode:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; FIRST 1 // Log first row&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; LOAD IsNum(left(@1:n,1)) as X // Test first char. Set to true if it's a number.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; FROM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; [$(_logpath)]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; (fix, $(vEncoding))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; WHERE RecNo()&amp;gt;1 // Skip rec 1, which causes problems if it has a BOM (Byte Order Marker)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; EXIT FOR WHEN peek('X'); // If a number, assume we have the right encoding.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NEXT vEncoding;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DROP TABLE TempCode;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and then $(vEncoding) is used in the LOAD statement.&amp;nbsp; You may have to adjust the "IsNum(" test for your data. I know I'm looking for a number in that position, you may have to look at something specific to your data.&amp;nbsp; If it's something you can recognize, then you have the right codepage for that file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Rob&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:33:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Code-Issues/m-p/1546553#M598730</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2019-02-19T19:33:02Z</dc:date>
    </item>
  </channel>
</rss>

