<?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 Lecture fichier texte in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2540434#M1226789</link>
    <description>&lt;P&gt;Bonjour&lt;/P&gt;&lt;P&gt;Je souhaite remettre sous forme d'une table avec des champs A,B,C,D un fichier texte qui est structuré comme indiqué ci-dessous:&lt;/P&gt;&lt;P&gt;NomChampA&lt;/P&gt;&lt;P&gt;NomChampB&lt;/P&gt;&lt;P&gt;NomChampC&lt;/P&gt;&lt;P&gt;NomChampD&lt;/P&gt;&lt;P&gt;Valeur A1&lt;/P&gt;&lt;P&gt;Valeur B1&lt;/P&gt;&lt;P&gt;Valeur C1&lt;/P&gt;&lt;P&gt;Valeur D1&lt;/P&gt;&lt;P&gt;Valeur A2&lt;/P&gt;&lt;P&gt;Valeur B2&lt;/P&gt;&lt;P&gt;Valeur C2&lt;/P&gt;&lt;P&gt;Valeur D2&lt;/P&gt;&lt;P&gt;Valeur A3&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;Quelqu'un aurait-il une solution générique ou la valeur de "pas" (&amp;lt;=&amp;gt;nb de champs) pourrait être n'importe quel entier entre 2 et N ?&lt;/P&gt;&lt;P&gt;Merci d'avance&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jan 2026 17:43:00 GMT</pubDate>
    <dc:creator>DTL</dc:creator>
    <dc:date>2026-01-07T17:43:00Z</dc:date>
    <item>
      <title>Lecture fichier texte</title>
      <link>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2540434#M1226789</link>
      <description>&lt;P&gt;Bonjour&lt;/P&gt;&lt;P&gt;Je souhaite remettre sous forme d'une table avec des champs A,B,C,D un fichier texte qui est structuré comme indiqué ci-dessous:&lt;/P&gt;&lt;P&gt;NomChampA&lt;/P&gt;&lt;P&gt;NomChampB&lt;/P&gt;&lt;P&gt;NomChampC&lt;/P&gt;&lt;P&gt;NomChampD&lt;/P&gt;&lt;P&gt;Valeur A1&lt;/P&gt;&lt;P&gt;Valeur B1&lt;/P&gt;&lt;P&gt;Valeur C1&lt;/P&gt;&lt;P&gt;Valeur D1&lt;/P&gt;&lt;P&gt;Valeur A2&lt;/P&gt;&lt;P&gt;Valeur B2&lt;/P&gt;&lt;P&gt;Valeur C2&lt;/P&gt;&lt;P&gt;Valeur D2&lt;/P&gt;&lt;P&gt;Valeur A3&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;Quelqu'un aurait-il une solution générique ou la valeur de "pas" (&amp;lt;=&amp;gt;nb de champs) pourrait être n'importe quel entier entre 2 et N ?&lt;/P&gt;&lt;P&gt;Merci d'avance&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2026 17:43:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2540434#M1226789</guid>
      <dc:creator>DTL</dc:creator>
      <dc:date>2026-01-07T17:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Lecture fichier texte</title>
      <link>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2540765#M1226794</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/106130"&gt;@DTL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure if there is a generic way to do it, but if you know the number of fields and how many values there are for each, you can use the following code to obtain a table with the field names and its values:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;LET N = 4; //number of fields&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;LET M = 2; //values per field&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;A:&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;LOAD Field&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;INLINE [&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Field&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NomChampA&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NomChampB&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NomChampC&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NomChampD&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur A1&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur B1&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur C1&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur D1&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur A2&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur B2&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur C2&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;Valeur D2&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;];&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;FOR i=0 to $(N)-1&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;LET vfieldname = peek('Field',i,'A');&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;FOR j= 0 to $(M)-1&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;LET vfieldvalue = peek('Field',i+(j+1)*$(N),'A');&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;B_$(i):&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;LOAD '$(vfieldvalue)' as $(vfieldname),&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt; '$(j)' as Link&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;AutoGenerate(1);&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NEXT j;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NEXT i;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;FOR i=1 to $(N)-1&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;INNER JOIN(B_0)&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;LOAD *&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;RESIDENT B_$(i);&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;DROP TABLE B_$(i);&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;NEXT i;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;DROP TABLE A;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&lt;FONT size="2"&gt;DROP FIELD Link;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 11:42:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2540765#M1226794</guid>
      <dc:creator>Daniel_Castella</dc:creator>
      <dc:date>2026-01-13T11:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lecture fichier texte</title>
      <link>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2540771#M1226795</link>
      <description>&lt;P&gt;Beside the provided loop-approach you could match the belonging values to a dedicated record, aggregating the data on this level and then distributing them to fields, for example per:&lt;/P&gt;&lt;P&gt;t1: load YourField, ceil(recno() / 4) as Record, recno() as RecNo&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;from X;&lt;/P&gt;&lt;P&gt;t2: load concat(YourField, '|', RecNo) as FieldString&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;resident t1 where Record &amp;gt; 1 group by Record;&lt;/P&gt;&lt;P&gt;t3: load subfield(FieldString, '|', 1) as Field1,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;subfield(FieldString, '|', 2) as Field2,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;BR /&gt;resident t2;&lt;/P&gt;&lt;P&gt;If the data contain an unknown number of fields and even more worse different numbers of fields per record the detection-logic might be need some interrecord-functions, for example:&lt;/P&gt;&lt;P&gt;t1: load YourField,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(mid(YourField, n, n) =&amp;nbsp;mid(previous(YourField), n, n),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rangesum(peek('Record'), 1), 1) as Record&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;from X;&lt;/P&gt;&lt;P&gt;whereby the mid() is just a placeholder for a valid differentiating-pattern between values from the same record and the next ones. With real data it's probably a bit more complex - just take it as starting point ...&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2026 14:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2540771#M1226795</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-01-13T14:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lecture fichier texte</title>
      <link>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2541075#M1226803</link>
      <description>&lt;P&gt;Salut DTL,&lt;/P&gt;&lt;P&gt;another solution could be&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoWedel_0-1768771414101.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/186281iA06E47A96B86F958/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoWedel_0-1768771414101.png" alt="MarcoWedel_0-1768771414101.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET vNbChamp = 4;

tabFichierTexte:
LOAD @1 as Ligne Inline [
NomChampA
NomChampB
NomChampC
NomChampD
Valeur A1
Valeur B1
Valeur C1
Valeur D1
Valeur A2
Valeur B2
Valeur C2
Valeur D2
Valeur A3
Valeur B3
Valeur C3
Valeur D3
Valeur A4
Valeur B4
Valeur C4
Valeur D4
] (no labels);

mapNomChamp:
Mapping
LOAD 'Champ'&amp;amp;RecNo(),
     Ligne
Resident tabFichierTexte
Where RecNo() &amp;lt;= $(vNbChamp);

tabResult:
Generic
LOAD Div(RecNo()-1,$(vNbChamp)) as IdEnreg,
     'Champ'&amp;amp;(Mod(RecNo()-1,$(vNbChamp))+1),
     Ligne
Resident tabFichierTexte
Where RecNo() &amp;gt; $(vNbChamp);     

DROP Table tabFichierTexte;
RENAME Fields using mapNomChamp;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;optionally combining the resulting tables into one like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tabResultComb:
LOAD '' as TempField AutoGenerate 0;

FOR i = NoOfTables()-1 to 0 STEP -1
  LET vTable=TableName($(i));
  IF WildMatch('$(vTable)', 'tabResult.*') THEN
    JOIN (tabResultComb) LOAD * RESIDENT [$(vTable)];
    DROP TABLE [$(vTable)];
  ENDIF
NEXT i

DROP Field TempField;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2026 17:18:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lecture-fichier-texte/m-p/2541075#M1226803</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2026-03-23T17:18:02Z</dc:date>
    </item>
  </channel>
</rss>

