<?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: delete files from the directory in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/delete-files-from-the-directory/m-p/20052#M13531</link>
    <description>&lt;P&gt;Hi @Rakesh Reddy Gopidi​&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the os module to iterate over a directory.&lt;/P&gt;&lt;P&gt;By using a loop over the directory, you can check what the file ends with using .endsWith(".csv).&lt;/P&gt;&lt;P&gt;After fetching all the files, you can remove it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps..&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;</description>
    <pubDate>Sat, 03 Dec 2022 08:31:30 GMT</pubDate>
    <dc:creator>UmaMahesh1</dc:creator>
    <dc:date>2022-12-03T08:31:30Z</dc:date>
    <item>
      <title>delete files from the directory</title>
      <link>https://community.databricks.com/t5/data-engineering/delete-files-from-the-directory/m-p/20050#M13529</link>
      <description>&lt;P&gt;Is there a way to delete recursively files using a command in notebooks&lt;/P&gt;&lt;P&gt;since in the below directory i have many combination of files like .txt,,png,.jpg but i only want to delete files with .csv &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example dbfs:/FileStore/.csv*&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 13:28:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delete-files-from-the-directory/m-p/20050#M13529</guid>
      <dc:creator>db-avengers2rul</dc:creator>
      <dc:date>2022-11-29T13:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: delete files from the directory</title>
      <link>https://community.databricks.com/t5/data-engineering/delete-files-from-the-directory/m-p/20051#M13530</link>
      <description>&lt;P&gt;%fs rm -r dbfs:/FileStore/.csv*&lt;/P&gt;&lt;P&gt;dbutils.fs.rm('dbfs:/FileStore/.csv*', True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this correct ? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 13:30:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delete-files-from-the-directory/m-p/20051#M13530</guid>
      <dc:creator>db-avengers2rul</dc:creator>
      <dc:date>2022-11-29T13:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: delete files from the directory</title>
      <link>https://community.databricks.com/t5/data-engineering/delete-files-from-the-directory/m-p/20052#M13531</link>
      <description>&lt;P&gt;Hi @Rakesh Reddy Gopidi​&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the os module to iterate over a directory.&lt;/P&gt;&lt;P&gt;By using a loop over the directory, you can check what the file ends with using .endsWith(".csv).&lt;/P&gt;&lt;P&gt;After fetching all the files, you can remove it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps..&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 08:31:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delete-files-from-the-directory/m-p/20052#M13531</guid>
      <dc:creator>UmaMahesh1</dc:creator>
      <dc:date>2022-12-03T08:31:30Z</dc:date>
    </item>
  </channel>
</rss>

