UiPath Documentation
studiox
2024.10
true
Importante :
Este contenido se ha localizado parcialmente a partir de un sistema de traducción automática. La localización de contenidos recién publicados puede tardar entre una y dos semanas en estar disponible.
UiPath logo, featuring letters U and I in white

StudioX user guide

Última actualización 30 de abr. de 2026

Tutorial: Añadir información en los archivos de una carpeta a un archivo de Excel

En este tutorial, crearemos una automatización que recupere el nombre y el tamaño de todos los archivos de una carpeta y lo agregue a un archivo de Excel.

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. Configurar un proyecto y crear un archivo de Excel en la carpeta del proyecto.
    1. Create a new blank project using the default settings.
    2. Crear un archivo de Excel en la carpeta del proyecto y nombrarlo archivos.xlsx.
    3. Abre el archivo recién creado en Excel y escribe el texto File Name en la celda A1 y el texto File Size en la celda B1.
    4. Guardar y cerrar archivos.xlsx.
  2. Agregar el archivo de Excel al proyecto e indicar la carpeta cuyos archivos se deben iterar.
    1. En StudioX, en el panel de Actividades, selecciona la pestaña Excel y luego haz doble clic en Usar archivo Excel. Se añade al panel Diseñador una actividad Utilizar archivo de Excel.

    2. En la actividad Usar archivo de Excel:

      • Click Browse Imagen de documentos next to the Excel file field, and then browse to and select the file files.xlsx.
      • En el campo Referencia como introduce NamesSizes.
    3. En el panel de Actividades, selecciona la pestaña Archivo, y después arrastra la actividad Para cada archivo de la carpeta y suéltala dentro de la actividad Usar archivo de Excel.

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

      Imagen de documentos

  3. Copiar la información sobre los archivos en el archivo de Excel.
    1. En el panel de Actividades, selecciona la pestaña Excel y luego arrastra una actividad Escribir celda y suéltala dentro para cada archivo de la carpeta.

    2. En la actividad Escribir celda:

      • Click Plus Imagen de documentos 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 Imagen de documentos 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. Agrega una segunda actividad Escribir celda debajo de la primera vez.

    4. En la actividad Escribir celda:

      • Click Plus Imagen de documentos 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 Imagen de documentos 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. Para hacer más fácilmente identificables las dos actividades de Write Celda, edita el nombre en la barra superior de cada una. Write Cell SizePor ejemplo, utilizar Write Cell Namepara la primera y la segunda actividad.

    6. En el panel de actividades, arrastra una actividad Anexar rango y suéltala dentro de Para cada archivo de la carpeta, en la segunda actividad Escribir celda.

    7. En la actividad Anexar rango:

      • Click Plus Imagen de documentos 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.

        Imagen de documentos

    8. Haz clic en Guardar en la cinta de opciones de StudioX para guardar la automatización y, después, haz clic en Ejecutar la automatización.

      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

¿Te ha resultado útil esta página?

Conectar

¿Necesita ayuda? Soporte

¿Quiere aprender? UiPath Academy

¿Tiene alguna pregunta? Foro de UiPath

Manténgase actualizado