UiPath Documentation
studiox
2023.10
false
Wichtig :
Bitte beachten Sie, dass dieser Inhalt teilweise mithilfe von maschineller Übersetzung lokalisiert wurde. Es kann 1–2 Wochen dauern, bis die Lokalisierung neu veröffentlichter Inhalte verfügbar ist.
UiPath logo, featuring letters U and I in white

StudioX user guide

Letzte Aktualisierung 30. Apr. 2026

Tutorial: Hinzufügen von Informationen über die Dateien in einem Ordner zu einer Excel-Datei

In diesem Tutorial erstellen wir eine Automatisierung, die den Namen und die Größe aller Dateien in einem Ordner abruft und diese Informationen einer Excel-Datei hinzufügt.

We will create a project and start by adding a Use Excel File activity to indicate the Excel file to use. We will then add a For Each File In Folder activity to indicate the folder from which to retrieve file information. Inside For Each File in Folder, we will add two Write Cell activities, one to copy the name, the other to copy the size of each file to two cells in the Project Notebook. We will finish by adding an Append Range activity that appends the two cells to a range in an Excel file after the cells are populated for each file.

  1. Richten Sie ein Projekt ein und erstellen Sie eine Excel-Datei im Projektordner.
    1. Create a new blank project using the default settings.
    2. Erstellen Sie eine Excel-Datei im Projektordner, und nennen Sie sie Dateien.xlsx.
    3. Öffnen Sie die neu erstellte Datei in Excel, und geben Sie den Text File Name in Zelle A1 und den Text File Size in Zelle B1 ein.
    4. Speichern und Schließen Sie Dateien.xlsx.
  2. Fügen Sie die Excel-Datei zum Projekt hinzu, und geben Sie den Ordner an, durch dessen Dateien iteriert werden soll.
    1. Wählen Sie in StudioX im Aktivitätenbereich die Registerkarte Excel aus, und doppelklicken Sie dann auf Excel-Datei verwenden. Dem Entwurfsbereich wird eine „Excel-Datei verwenden“-Aktivität (Use Excel File) hinzugefügt.

    2. In der Aktivität Excel-Datei verwenden (Use Excel File):

      • Click Browse Dokumentationsbild next to the Excel file field, and then browse to and select the file files.xlsx.
      • Geben Sie im Feld Referenzieren als NamesSizes ein.
    3. Wählen Sie im Aktivitätenbereich die Registerkarte Datei aus, und ziehen Sie dann die Aktivität Für jede Datei im Ordner (For Each File In Folder) und legen Sie innerhalb der Aktivität „Excel-Datei verwenden“ (Use Excel File) ab.

    4. In the For Each File in Folder activity, click Browse Dokumentationsbild next to the In folder field, and then browse to and select a folder on your computer which contains files, for example the Desktop.

      Dokumentationsbild

  3. Kopieren Sie Informationen über die Dateien in die Excel-Datei.
    1. Wählen Sie im Aktivitätenbereich die Registerkarte Excel aus, und ziehen Sie dann eine Zelle schreiben-Aktivität (Write Cell) und legen Sie innerhalb von „Für jede Datei im Ordner“ ab.

    2. In der Aktivität „Zelle schreiben“ (Write Cell):

      • Click Plus Dokumentationsbild on the right side of the What to write field, and then select CurrentFile > Name to indicate that we want to copy the name of the current file in the iteration.
      • Click Plus Dokumentationsbild on the right side of the Where to write field, and then select Notebook > Indicate in Excel to open the Project Notebook. In the file, select the A1 cell in the Scratchpad sheet, and click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to paste the name of the current file in the iteration to cell A1 in the Scratchpad sheet of the Project Notebook.
    3. Fügen Sie eine zweite „Zelle schreiben“-Aktivität (Write Cell) unterhalb der ersten hinzu.

    4. In der Aktivität „Zelle schreiben“ (Write Cell):

      • Click Plus Dokumentationsbild on the right side of the What to write field, and then select CurrentFile > Size to indicate that we want to copy the size (in bytes) of the current file in the iteration.
      • Click Plus Dokumentationsbild on the right side of the Where to write field, and then select Notebook > Indicate in Excel to open the Project Notebook. In the file, select the B1 cell in the Scratchpad sheet, and click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to paste the size of the current file in the iteration to cell B1 in the Scratchpad sheet of the NamesSizes Excel file.
    5. Um die beiden „Zelle schreiben“-Aktivität (Write Cell) leichter identifizierbar zu machen, bearbeiten Sie den Namen in der oberen Leiste jeder einzelnen. Verwenden Sie beispielsweise Write Cell Name für die erste Aktivität und Write Cell Size für die zweite Aktivität.

    6. Ziehen Sie eine Bereich anfügen-Aktivität (Append Range) aus dem Aktivitätenbereich, und legen Sie sie in „Für jede Datei im Ordner“ unter der zweiten „Zelle schreiben“-Aktivität (Write Cell) ab.

    7. In der Aktivität „Bereich anfügen“ (Append Range):

      • Click Plus Dokumentationsbild on the right side of the Append after range field and then select NamesSizes > Sheet1.

      • Click Plus docs image on the right side of the Excel range to append field, and then select Notebook > Indicate in Excel to open the file in Excel. In the file, select the A1:B1 cells and click Confirm in the UiPath tab in the Excel ribbon. You have indicated that you want to add the information about the current file in the iteration to columns A and B in the NamesSizes file after the existing data in the file.

        Dokumentationsbild

    8. Klicken Sie im StudioX-Menüband auf Speichern, um die Automatisierung zu speichern, und klicken Sie dann auf Ausführen, um die Automatisierung auszuführen.

      The name and size of each file in the indicated folder are copied one by one to cells A1 and A2 in the Scratchpad sheet of the Project Notebook, and then appended to files.xlsx.Download example

War diese Seite hilfreich?

Verbinden

Benötigen Sie Hilfe? Support

Möchten Sie lernen? UiPath Academy

Haben Sie Fragen? UiPath-Forum

Auf dem neuesten Stand bleiben