Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Buenos dias, como estan?
Queria hacer una consulta.
Tengo un archivo en xlsx con una columna FECHA , existe forma de generar x cantidad de archivos de salida dependiendo de la fecha que venga en el archivo de entrada?
Por ejemplo que me genere y separe: archivosalida20250804.xlsx(todo lo que en el archivo de entrada haya tenido la fecha 20250804)
archivosalida20250803.xlsx(todo lo que en el archivo de entrada haya tenido la fecha 20250803)
etc...
No se la cantidad de fechas que pueden venir en este campo, por ende lo que quiero es que se vayan generando segun los diferentes dias que vienen en ese campo.
Desde ya muchas gracias, saludos!
Hello @arysg2
Here is a job that could solve your problem :
I'm going to explain it to you step by step :
1 - Read the file like you would normally.
2 - Connect this component to a tHashOutput. This "save" the full file data to the memory.
Talend sometimes hides the Hash components for some odd reason but you can re-enable them by adding them back in the Project Properties -> Designer -> Palette settings and under "Technical" category.
3 - Use tHashInput to load the data back into the job and connect it to a tAggregateRow.
4 - In the tAggregateRow use the "Group by" category and use your date field. This will create a list of distinct date values from your file.
5 - Then add and connect the component to a tFlowToIterate. From this distinct list of values we will start iterating on your file.
6 - Re-add a tHashInput to get the full file once again
7 - Add a tFilterRow and use your date field inside the component with the operator "Equal to" with the value :
((String)globalMap.get("row3.date")
This will only let the values from your file that have a date value equal to the "current" one from the iterate.
8 - Add a tFileOutputDelimited and name the file with your date column :
"C:/Program Files (x86)/Talend-Studio/studio/workspace/out" + ((String)globalMap.get("row3.date") +".csv"
Don't forget to check the schema for each component especially the tHashInput/Output
Tell me if you still need more help, otherwise don't forget to give a like and accept it as a solution if this solved your problem
- Quentin
Hello @arysg2
Here is a job that could solve your problem :
I'm going to explain it to you step by step :
1 - Read the file like you would normally.
2 - Connect this component to a tHashOutput. This "save" the full file data to the memory.
Talend sometimes hides the Hash components for some odd reason but you can re-enable them by adding them back in the Project Properties -> Designer -> Palette settings and under "Technical" category.
3 - Use tHashInput to load the data back into the job and connect it to a tAggregateRow.
4 - In the tAggregateRow use the "Group by" category and use your date field. This will create a list of distinct date values from your file.
5 - Then add and connect the component to a tFlowToIterate. From this distinct list of values we will start iterating on your file.
6 - Re-add a tHashInput to get the full file once again
7 - Add a tFilterRow and use your date field inside the component with the operator "Equal to" with the value :
((String)globalMap.get("row3.date")
This will only let the values from your file that have a date value equal to the "current" one from the iterate.
8 - Add a tFileOutputDelimited and name the file with your date column :
"C:/Program Files (x86)/Talend-Studio/studio/workspace/out" + ((String)globalMap.get("row3.date") +".csv"
Don't forget to check the schema for each component especially the tHashInput/Output
Tell me if you still need more help, otherwise don't forget to give a like and accept it as a solution if this solved your problem
- Quentin
Thanks !