Multiple output files from a single input file

Is there any way to create a set of output files from a single input file?

For example, I would like to take an XML file and based on the content split it up into a set of markdown files.

Just add as many output file nodes as you need. I think almost every transform I’ve ever put together has multiple outputs.

My favorite trick is to name the same file in each output with a different sheet name - whatever.xlxs[sheet name] - to create named sheets in a single output file.

If you use overwrite mode, you need to set “sheet” instead of “file” when you do that.

I see the Mac version of EDT offers Markdown output - I need to experiment with that. Sounds intriguing.

1 Like

As @Amontillado says, you can add as many output nodes as you like to an input or transform.

One of the things we are hoping to add in future is to be able to define the output file name in a column, so you change the file(s) you are outputting to dynamically in the data. For example, you could use this to split a big file into 1000 line chunks without knowing in advance how big the input file is. But we don’t have that yet.

1 Like

Thank you both for your reply. I think Andy hit the nail on the head. I am looking to create a new output file for each “row” (or XML equivalent). I can’t do that with multiple outputs in the transform since I don’t know how many rows there are and it would be very tedious.

Guess I’ll have to wait for the new functionality (or write some code :frowning: )

It is quite high on the wishlist. But we need to smooth off a few rough edges before we start adding new features.

Where there’s a will, there’s probably a way.

How about creating a column in a single output file that contains the file name you want that line written to?

Write the output to CSV, and read it in, say, Python. Write each line to the filename specified in the filename column.

I could be missing the whole point, too. That happens - good luck!