- Primeros pasos
- Tutoriales
- Proyectos de automatización
- Crear automatizaciones
- Fundamentos de la automatización
- Repo. de objetos
- Mejores prácticas de automatización
- Tutorial: Crear una tabla dinámica
- Tutorial: Iterar a través de las filas de una tabla
- Tutorial: Comparar archivos de Excel y envío de errores de conciliación por correo electrónico
- Tutorial: Extraer datos de correos electrónicos automatizados y trasladarlos a una aplicación de escritorio
- Tutorial: Filtrar datos en Excel
- Tutorial: Formatear celdas
- Tutorial: Añadir información en los archivos de una carpeta a un archivo de Excel
- Tutorial: Añadir sus propias fórmulas al cuaderno del proyecto
- Automatización de PowerPoint
- Automatización de datos
- Actividades comunes
- Automatización de Google Workspace
- Automatización de OneDrive y SharePoint
- Solución de problemas
Guía del usuario de StudioX
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.
Crearemos un proyecto y comenzaremos añadiendo una actividad Usar archivo de Excel para indicar el archivo de Excel a utilizar. A continuación, añadiremos una actividad Para cada archivo en carpeta para indicar la carpeta desde la que recuperar la información del archivo. Dentro de Para cada archivo de la carpeta, añadiremos dos actividades Escribir celda , una para copiar el nombre y la otra para copiar el tamaño de cada archivo en dos celdas del Cuaderno del proyecto. Terminaremos añadiendo una actividad Anexar rango que anexa las dos celdas a un rango en un archivo de Excel después de que se rellenen las celdas para cada archivo.
- Configurar un proyecto y crear un archivo de Excel en la carpeta del proyecto.
- Crea un nuevo proyecto en blanco utilizando la configuración predeterminada.
- Crear un archivo de Excel en la carpeta del proyecto y nombrarlo archivos.xlsx.
- Abre el archivo recién creado en Excel y escribe el texto
File Nameen la celda A1 y el textoFile Sizeen la celda B1. - Guardar y cerrar archivos.xlsx.
- Agregar el archivo de Excel al proyecto e indicar la carpeta cuyos archivos se deben iterar.
-
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.
-
En la actividad Usar archivo de Excel:
- Click Browse
next to the Excel file field, and then browse to and select the file files.xlsx. - En el campo Referencia como introduce
NamesSizes.
- Click Browse
-
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.
-
In the For Each File in Folder activity, click Browse
next to the In folder field, and then browse to and select a folder on your computer which contains files, for example the Desktop.
-
- Copiar la información sobre los archivos en el archivo de Excel.
-
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.
-
En la actividad Escribir celda:
- Click Plus
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
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.
- Click Plus
-
Agrega una segunda actividad Escribir celda debajo de la primera vez.
-
En la actividad Escribir celda:
- Click Plus
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
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.
- Click Plus
-
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, utilizarWrite Cell Namepara la primera y la segunda actividad. -
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.
-
En la actividad Anexar rango:
-
Click Plus
on the right side of the Append after range field and then select NamesSizes > Sheet1. -
Click Plus
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.
-
-
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.
El nombre y el tamaño de cada archivo de la carpeta indicada se copian uno a uno en las celdas A1 y A2 de la hoja del Bloc de notas del proyecto, y luego se anexan a files.xlsx.Descargar ejemplo
-