<?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 How to move files of same extension in databricks files system? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-move-files-of-same-extension-in-databricks-files-system/m-p/28656#M20433</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I am facing file not found exception when i am trying to move the file with * in DBFS. Here both source and destination directories are in DBFS. I have the source file named "test_sample.csv" available in dbfs directory and i am using the command like below from notebook cell,&lt;/P&gt;
&lt;P&gt; dbutils.fs.mv("dbfs:/usr/krishna/sample/test*.csv", "dbfs:/user/abc/Test/Test.csv")&lt;/P&gt;
&lt;P&gt;Error: &lt;/P&gt;
&lt;P&gt; java.io.FileNotFoundException: dbfs:/usr/krishna/sample/test*.csv&lt;/P&gt;
&lt;P&gt;Please suggest if there is any other way to do this. Thanks.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 13:29:45 GMT</pubDate>
    <dc:creator>bkr</dc:creator>
    <dc:date>2018-06-08T13:29:45Z</dc:date>
    <item>
      <title>How to move files of same extension in databricks files system?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-move-files-of-same-extension-in-databricks-files-system/m-p/28656#M20433</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I am facing file not found exception when i am trying to move the file with * in DBFS. Here both source and destination directories are in DBFS. I have the source file named "test_sample.csv" available in dbfs directory and i am using the command like below from notebook cell,&lt;/P&gt;
&lt;P&gt; dbutils.fs.mv("dbfs:/usr/krishna/sample/test*.csv", "dbfs:/user/abc/Test/Test.csv")&lt;/P&gt;
&lt;P&gt;Error: &lt;/P&gt;
&lt;P&gt; java.io.FileNotFoundException: dbfs:/usr/krishna/sample/test*.csv&lt;/P&gt;
&lt;P&gt;Please suggest if there is any other way to do this. Thanks.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 13:29:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-move-files-of-same-extension-in-databricks-files-system/m-p/28656#M20433</guid>
      <dc:creator>bkr</dc:creator>
      <dc:date>2018-06-08T13:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to move files of same extension in databricks files system?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-move-files-of-same-extension-in-databricks-files-system/m-p/28657#M20434</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;@bkr, you can reference the file name using dbutils and then pass this to the move command. Here's an example for this in Scala:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;val fileNm = dbutils.fs.ls("/usr/krishna/sample").map(_.name).filter(r =&amp;gt; r.startsWith("test"))(0)
val fileLoc = "dbfs:/usr/krishna/sample/sample/" + fileNm
dbutils.fs.mv(fileLoc, "dbfs:/user/abc/Test/Test.csv")
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 16:45:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-move-files-of-same-extension-in-databricks-files-system/m-p/28657#M20434</guid>
      <dc:creator>ricardo_portill</dc:creator>
      <dc:date>2018-06-08T16:45:33Z</dc:date>
    </item>
  </channel>
</rss>

