<?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>question Re: Extract timestamp from filename and add it in new column(say,date) by using Pig in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191298#M68371</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/21188/tsharma.html" nodeid="21188"&gt;@tsharma&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thanks for your prompt reply..i'll try this approach but by-tagFile we tagged file name with all the column name, here what i want is to create a new column like date and store the file name in it.. &lt;/P&gt;&lt;P&gt;Thank you. &lt;/P&gt;</description>
    <pubDate>Thu, 21 Sep 2017 08:43:20 GMT</pubDate>
    <dc:creator>Sume77</dc:creator>
    <dc:date>2017-09-21T08:43:20Z</dc:date>
    <item>
      <title>Extract timestamp from filename and add it in new column(say,date) by using Pig</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191296#M68369</link>
      <description>&lt;P&gt;I have a file with name YYYYMMDD_claims_portal.csv, i need only YYYYMMDD part and store this value in new column(say,date). Earlier we have 3 column like Claim,User,ID. now i need to add one more column date having value as YYYYMMDD as per file. Please help, its bit urgent.&lt;/P&gt;&lt;P&gt;Thanks in advance for any help you guys can provide.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 21:39:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191296#M68369</guid>
      <dc:creator>Sume77</dc:creator>
      <dc:date>2017-09-20T21:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract timestamp from filename and add it in new column(say,date) by using Pig</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191297#M68370</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/44205/guptasumedhar.html" nodeid="44205"&gt;@Sumee singh&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please try this:&lt;/P&gt;&lt;P&gt;A = LOAD 'YYYYMMDD_claims_portal.csv' using PigStorage(',','-tagFile');&lt;/P&gt;&lt;P&gt;y = FOREACH A GENERATE SUBSTRING($0,0,8),$1..;&lt;/P&gt;&lt;P&gt;DUMP y;&lt;/P&gt;&lt;P&gt;(Input file name comes as the first field in tuple). You can modify after this as you wish.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 21:59:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191297#M68370</guid>
      <dc:creator>tsharma</dc:creator>
      <dc:date>2017-09-20T21:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extract timestamp from filename and add it in new column(say,date) by using Pig</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191298#M68371</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/21188/tsharma.html" nodeid="21188"&gt;@tsharma&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thanks for your prompt reply..i'll try this approach but by-tagFile we tagged file name with all the column name, here what i want is to create a new column like date and store the file name in it.. &lt;/P&gt;&lt;P&gt;Thank you. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 08:43:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191298#M68371</guid>
      <dc:creator>Sume77</dc:creator>
      <dc:date>2017-09-21T08:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract timestamp from filename and add it in new column(say,date) by using Pig</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191299#M68372</link>
      <description>&lt;P&gt;Ok, do this:-&lt;/P&gt;&lt;P&gt;A = LOAD 'YYYYMMDD_claims_portal.csv' using PigStorage(',','-tagFile') AS (filename:chararray, {other columns as per your schema})&lt;/P&gt;&lt;P&gt;y = FOREACH A GENERATE $1..,SUBSTRING(filename,0,8) AS day;&lt;/P&gt;&lt;P&gt;describe y;&lt;/P&gt;&lt;P&gt;DUMP y;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 13:59:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191299#M68372</guid>
      <dc:creator>tsharma</dc:creator>
      <dc:date>2017-09-21T13:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract timestamp from filename and add it in new column(say,date) by using Pig</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191300#M68373</link>
      <description>&lt;P&gt;Thanks @tsharma.. This works.. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2017 11:12:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Extract-timestamp-from-filename-and-add-it-in-new-column-say/m-p/191300#M68373</guid>
      <dc:creator>Sume77</dc:creator>
      <dc:date>2017-09-24T11:12:21Z</dc:date>
    </item>
  </channel>
</rss>

