如何在 Azure Databricks 中使用 Python 连接和读取 Azure FTP 文件夹中的文件?

How to connect and read files from Azure FTP folder using Python in Azure Databricks?

我需要在 Azure Databricks 中使用 Python 来执行以下操作:

  1. 合并存储在 Azure FTP 文件夹中的多个文本文件 (\VMAZR1\ABCDFiles)。这里,'VMAZR1' 是服务器名称,'ABCDFiles' 是文件夹名称
  2. 将合并后的文件以新名称存储在同一位置

我可以编写代码来进行合并,但我需要帮助才能连接到 Azure FTP 文件夹并仅读取文本文件名。有人可以帮忙吗?

您可以依靠这个 answer. Just change the method of storing to retrieving, e.g., retrbinary, or retrlines as well as mlsd 来获取文件名列表。