How to create a context load input file

One Star

How to create a context load input file

Dear all,
my job processes files. I move each file to a destination folder. The information of the destination folder is given and I put into a delimited file (plus further file specific information).
Because the destination folder is known and given in the delimited file, I try to load it with context load component. This gives me the chance to use the context.destination variable in my job which is quite comfortable.
My problem is: How to read the delimited file? The regular output is:
metadata1;destination;metadata2
xyz;C:\Whatever\P2;zwa
Context load expects this structure:
metadata1;xyz
destination;C:\Whatever\P2
metadata2;zwa
I'm not able to read the delimited files correctly at the moment. Is there a chance to create a context load readable format or would it be possible to read a delimited file and "re-structure" the data stream for the context load component?
Seventeen Stars

Re: How to create a context load input file

One Star

Re: How to create a context load input file

Do you use tContextLoad? Why not use the context values strung together to form the file path.
One Star

Re: How to create a context load input file

thanks kzone for the hint. I'll check that later on.
@janhess: Don't know exactly what you mean...the file path includes a string which is file-specific. In contexts without load i could not add this.
One Star

Re: How to create a context load input file

I don't really understand what you're trying to do. Do you want to use the context value for the input file or output? either way just use the context value in the file path.
One Star

Re: How to create a context load input file

First I create a delimited file including particular information (e.g. part of destination path). Later on I read that file as input for a context load. But as mentioned above, delimited files have a different structure as context load needed - see above.
One Star

Re: How to create a context load input file

What's the format of the delimited file? Why can't you create it in a format for context loader - you just need a file with 8 columns with a ; delimiter and a \n as the last value in columns 2,4,6 & 8. Put text value in columns 1,3,5 & 7.
One Star

Re: How to create a context load input file

When I create the delimited files (as a regular csv; here semicolon instead of a comma) it has the structure:
metadata1;destination;metadata2
xyz;C:\Whatever\P2;zwa
This is created by a regular data stream - for example reading in file properties or you use a tmap etc. component.
But a context load component expects this structure:
metadata1;xyz
destination;C:\Whatever\P2
metadata2;zwa
Here the header is not in the first line of the file but as first column/argument/field.
I don't create the context load file manually. I could not find an FileOutput format that is readable for the context load component. That's why I ask for a possibility to create such files or to transform them after the delimited file has been read (here as FileInputDelimited).
One Star

Re: How to create a context load input file

Read in your delimited file and map it as I described above.