# CSV Writer

**URL:** <https://forum.knime.com/t/csv-writer/357>\
**Category:** KNIME Analytics Platform\
**Created:** [January 13, 2009, 4:43pm UTC](https://forum.knime.com/t/csv-writer/357 "2009-01-13T16:43:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aborg](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@aborg](https://forum.knime.com/u/aborg)\
**Post date:** [January 13, 2009, 4:43pm UTC](https://forum.knime.com/t/csv-writer/357/1 "2009-01-13T16:43:26Z")

</div>

Hi,

Would it be possible to have the file name at an outport of _CSV Writer_? It would be useful if we have to process some results outside KNIME, or with a command line tool inside KNIME. (This is a kind of feature request.)  
Thanks, gabor

(PS.: I have found a bit unintuitive that I can set in the _File Reader_ node the tab as `<tab>`, while in _CSV Writer_ this is `\t`. It is documented difference, just not as intuitive as I expected.)

---

<div class="post-metadata">

**Author:** ![jasonmvictor](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jasonmvictor/32/40_2.png) [@jasonmvictor](https://forum.knime.com/u/jasonmvictor)\
**Post date:** [June 4, 2015, 10:11pm UTC](https://forum.knime.com/t/csv-writer/357/2 "2015-06-04T22:11:10Z")

</div>

I found a workaround for this. &nbsp;If you put a "Document Data Extractor" node in there, you can add back in the "File Path" in the settings. &nbsp;Then you have the original file name of the original&nbsp;document.

&nbsp;

[some document table] --\> Document Data Extractor --\> CSV Writer

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![pskale](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/p/8c91f0/32.png) [@pskale](https://forum.knime.com/u/pskale)\
**Post date:** [June 5, 2015, 9:13am UTC](https://forum.knime.com/t/csv-writer/357/3 "2015-06-05T09:13:37Z")

</div>

I might understand your problem differently than @jasonmvictor. As I understand it, you would like to write a table to CSV file with CSV Writer. Ouput file will exist at some location (eg. c:\Users\jdoe\file.csv) and this location you would like to export from CSV Writer. If this is correct you can do this:

- Open CSV Writer node configuration.
- Go to "Flow Variables"
- Under "filename" write a variable name into rightmost input field.
- Close configuration dialog.
- Right click on CSV Writer node and select "Show Flow Variable Ports"
- Attach "Variable to Table Row" node to the ouput port of CSV Writer node.
- Open configuration dialog for "Variable to Table Row" node and select exposed filename variable into "include columns" section.
- (remember to first run CSV Writer node if there is no exposed filename variable in left column)
- (see attached image for better reference)

&nbsp;

- [img.png](https://www.knime.com/sites/default/files/img.png)

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:14pm UTC](https://forum.knime.com/t/csv-writer/357/4 "2023-06-23T20:14:30Z")

</div>


