Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this flow:
tDBInput - tmap - tflowtoiterate - tfixedinput - tfileoutputdelimited
At the beginning i have a "table" with 3 columns: col1, col2, col3. In the tmap i keep col3 and i create another col (fichName) as col1 + col2. What i want at the end is to have one file for each row and name fichName. Example:
if i had only 1 row in the first table i want to get only 1 file which content is the value of col3 for that only row and the name of that file should be
fichName (
col1 + col2)I have tried with this flow for a lot of time, also with tsetglobalvar and i dont get the correct result. The closer i got was to have a file for each row containing the value of col3 as desired but the names of those files were null0, null1, null2, etc or simply 0, 1, 2, ...
Can you help me please?
Thanx in advance!
Thanx!
on tFlowToIterate, use the default the key,value in global variables, in this case, you don't need to use context variable.
Set the file path like:
"D:/file/"+(String)globalMap.get("out1.nomFich")+".csv"
on tFileOutputDelimited, uncheck the 'split the output in several files' box, you have used tFlowToIterate to iterate each row and set a dynamic file name. If you need a sequence id to be added to the file name, you can generate the sequence id on tMap and concatenate it to the file name
Hi @Beatriz Martinez Serna,
Would you mind showing us your job (a screenshot)? Also include screenshots of your file component's config. It looks like the right flow, I suspect that there is a slight config error. It looks like you are nearly there.
To use the current column value in the file name, the expression looks like below, eg:
"D:/file/"+(String)globalMap.get("out1.fichName")+".txt"
//out1 is the flow name after tMap.
Regards
Shong
Thanx, I think the problem is in the tFixedFlowInput. I have tried both keeping and not keeping "nombFich" and nothing. Now as i dont really know what i am doing, with the flow as it is, i only get only file again, not one per row as desired :'(
I tried that, but it didnt work either. Thanx anyway
on tFlowToIterate, use the default the key,value in global variables, in this case, you don't need to use context variable.
Set the file path like:
"D:/file/"+(String)globalMap.get("out1.nomFich")+".csv"
on tFileOutputDelimited, uncheck the 'split the output in several files' box, you have used tFlowToIterate to iterate each row and set a dynamic file name. If you need a sequence id to be added to the file name, you can generate the sequence id on tMap and concatenate it to the file name
Thanx a lot!! It made the trick!! 🙂