<?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: When loading CSV file, issue with LF, CR, and/or commas within a field in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2068153#M12253</link>
    <description>&lt;P&gt;I may not be explaining it correctly, but the data that should all be in the field 'Comment' is getting broken up into the next field. I'd like to know if there is a way to force that data to load in the correct field ?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2023 12:09:02 GMT</pubDate>
    <dc:creator>mfolmar</dc:creator>
    <dc:date>2023-05-05T12:09:02Z</dc:date>
    <item>
      <title>When loading CSV file, issue with LF, CR, and/or commas within a field</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067802#M12248</link>
      <description>&lt;P&gt;Hello! I have an issue when loading data from a CSV file where the data is loading into incorrect fields. The issue is when my Comment field has a Line Feed/Carriage Return or a comma directly after the file places the double quote in the Comment field.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Example of CSV data:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Number, Comment, Room&lt;/P&gt;
&lt;P&gt;1, "Size: 10T x 3"", moved to basement", 104&lt;/P&gt;
&lt;P&gt;2, "spiral staircase&lt;/P&gt;
&lt;P&gt;upstairs", 500&lt;/P&gt;
&lt;P&gt;3, "Part Numbers are as follows:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3x456t&lt;/P&gt;
&lt;P&gt;45""&lt;/P&gt;
&lt;P&gt;098432" , 750&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Output:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;TABLE width="503"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;Number&lt;/TD&gt;
&lt;TD width="200"&gt;Comment&amp;nbsp;&lt;/TD&gt;
&lt;TD width="239"&gt;Room&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;"Size: 10T x 3""&lt;/TD&gt;
&lt;TD&gt;moved to basement&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;"spiral staircase upstairs"&lt;/TD&gt;
&lt;TD&gt;500&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD width="200"&gt;"Part numbers are as follows: &lt;BR /&gt;3x456t&lt;BR /&gt;45""&lt;/TD&gt;
&lt;TD&gt;098432&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, its not every LF/CR or comma that causes issues, just the ones directly following those "" in the Comment that cause the data to move into the next field.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone recommend how to fix this? I've tried omitting msq in my load script, but that doesn't fix it, it makes things much worse. I'm rather new to Qlik Sense and I'm not sure if I'm explaining this correctly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 17:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067802#M12248</guid>
      <dc:creator>mfolmar</dc:creator>
      <dc:date>2023-05-04T17:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: When loading CSV file, issue with LF, CR, and/or commas within a field</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067846#M12249</link>
      <description>&lt;P&gt;Hi, as below.&lt;/P&gt;
&lt;P&gt;LOAD Number,&lt;BR /&gt;If(SubStringCount(Comment,'""') &amp;gt; 0,TextBetween(Comment,'"','""') ,Replace(Comment,'"','')) as Comment,&lt;BR /&gt;If(SubStringCount(Comment,'""') &amp;gt; 0,Text(Trim(PurgeChar(SubField(Comment,'""',2),',"'))),Text(Room)) as Room&lt;/P&gt;
&lt;P&gt;FROM SourceData;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrunPierre_1-1683229118719.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/106493i5B816209636D8230/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrunPierre_1-1683229118719.png" alt="BrunPierre_1-1683229118719.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 20:16:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067846#M12249</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2023-05-04T20:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: When loading CSV file, issue with LF, CR, and/or commas within a field</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067870#M12250</link>
      <description>&lt;P&gt;This doesn't produce the desired output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Room for Record #1 should not be 'moved to basement', it should be 104, and the Room for Record #3 should be 750.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way I can modify what you've come up with to produce those results?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 20:04:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067870#M12250</guid>
      <dc:creator>mfolmar</dc:creator>
      <dc:date>2023-05-04T20:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: When loading CSV file, issue with LF, CR, and/or commas within a field</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067889#M12251</link>
      <description>&lt;P&gt;Not according to the output table above.&lt;/P&gt;
&lt;P&gt;Anyways, that would mean loading the field as it is.&lt;/P&gt;
&lt;P&gt;LOAD Number,&lt;BR /&gt;If(SubStringCount(Comment,'""') &amp;gt; 0,TextBetween(Comment,'"','""') ,Replace(Comment,'"','')) as Comment,&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRIKE&gt;If(SubStringCount(Comment,'""') &amp;gt; 0,Text(Trim(PurgeChar(SubField(Comment,'""',2),',"'))),Text(Room)) as Room,&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;Room&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;FROM SourceData;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 21:44:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2067889#M12251</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2023-05-04T21:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: When loading CSV file, issue with LF, CR, and/or commas within a field</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2068153#M12253</link>
      <description>&lt;P&gt;I may not be explaining it correctly, but the data that should all be in the field 'Comment' is getting broken up into the next field. I'd like to know if there is a way to force that data to load in the correct field ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 12:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2068153#M12253</guid>
      <dc:creator>mfolmar</dc:creator>
      <dc:date>2023-05-05T12:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: When loading CSV file, issue with LF, CR, and/or commas within a field</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2068675#M12259</link>
      <description>&lt;P&gt;AFAIK there are no ways to load such invalid data from a text-file within a single step just by specifying the file-format and/or in combination with data-manipulation with functions like subfield/textbetween.&lt;/P&gt;
&lt;P&gt;If possible try to load this information from an origin Excel or a data-base source - maybe you could get an appropriate access.&lt;/P&gt;
&lt;P&gt;If not you need to apply a multi-step approach. One way could be to load the file at first without any delimiter in the fixed mode. Now the entire record is within a single field - and on this you could do various data-cleaning (counting, detecting and removing the garbage). Afterwards the table might be stored as text-file again or you load from_field.&lt;/P&gt;
&lt;P&gt;Another method would be to load the file with a delimiter and applying afterwards various checks on the field-content in regard to the previous records - using interrecord-functions like previous() and peek() to detect and repair the wrong ones.&lt;/P&gt;
&lt;P&gt;Depending on the data it could become quite hard to correct the garbage data ...&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 12:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2068675#M12259</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-05-08T12:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: When loading CSV file, issue with LF, CR, and/or commas within a field</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2074498#M12310</link>
      <description>&lt;P&gt;FYI in case anyone reads this in the future, Qlik development corrected the error and rolled the solution out yesterday.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 15:40:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/When-loading-CSV-file-issue-with-LF-CR-and-or-commas-within-a/m-p/2074498#M12310</guid>
      <dc:creator>mfolmar</dc:creator>
      <dc:date>2023-05-23T15:40:02Z</dc:date>
    </item>
  </channel>
</rss>

