<?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: Parse CSV with Buried Header in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6051#M2662</link>
    <description>&lt;P&gt;Thanks Gary! Will give this a try and report back.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Feb 2024 03:22:52 GMT</pubDate>
    <dc:creator>GrailAutomation</dc:creator>
    <dc:date>2024-02-02T03:22:52Z</dc:date>
    <item>
      <title>Parse CSV with Buried Header</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6047#M2660</link>
      <description>&lt;P&gt;I need to download and parse a CSV file. The problem is that the first three lines of the CSV are filled with various irrelevant bits of information that do not belong to the table. Row four of the CSV contains the headers; rows five and below contain the data.&lt;/P&gt;&lt;P&gt;I basically want to use the &lt;A href="https://docs.workato.com/developing-connectors/sdk/sdk-reference/ruby_methods.html#drop" target="_self"&gt;.drop&lt;/A&gt; method, but against a [File Contents] datapill.&lt;/P&gt;&lt;P&gt;The first image attached shows how I am downloading the CSV (represented by the [File Contents] datapill. The second image shows the error I receive when I try to use the &lt;FONT color="#FF00FF"&gt;.drop&lt;/FONT&gt; method (on the [File Contents] datapill) in the Parse CSV step that follows.&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 23:56:45 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6047#M2660</guid>
      <dc:creator>GrailAutomation</dc:creator>
      <dc:date>2024-02-01T23:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Parse CSV with Buried Header</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6049#M2661</link>
      <description>&lt;P&gt;You can only use drop on an array, so first split your CSV on line breaks, then drop, then join it back together with line breaks.&lt;/P&gt;&lt;P&gt;Heads up: if your data contains line breaks, this will also replace them. If that's a problem, there are other ways to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;## your csv
data = "1,2,3
4,5,6
7,8,9
header,header,header
data,data,data"

## fixer upper
data.split(/[\r\n]+/).drop(3).join("\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gary1_1-1706836715168.png" style="width: 400px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/992iAB86DC7BF6A05C30/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="gary1_1-1706836715168.png" alt="gary1_1-1706836715168.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 01:18:46 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6049#M2661</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2024-02-02T01:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Parse CSV with Buried Header</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6051#M2662</link>
      <description>&lt;P&gt;Thanks Gary! Will give this a try and report back.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 03:22:52 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6051#M2662</guid>
      <dc:creator>GrailAutomation</dc:creator>
      <dc:date>2024-02-02T03:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Parse CSV with Buried Header</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6075#M2664</link>
      <description>&lt;P&gt;OK so for the record, my biggest problem in all of this (not mentioned originally because I was unaware) is that I *thought* I was downloading a CSV from Google Drive... but turns out I was downloading a Sheet&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks Gary for your answer. I had to prepend a .to_s method since the [File contents] data pill is not a string (despite appearing that way in the data tree), then worked like a charm!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 19:17:34 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/parse-csv-with-buried-header/m-p/6075#M2664</guid>
      <dc:creator>GrailAutomation</dc:creator>
      <dc:date>2024-02-02T19:17:34Z</dc:date>
    </item>
  </channel>
</rss>

