Skip to main content
Solved

CSV file Fanout


Hi,

 

I am doing a fanout in writer for a csv file based on an attribute, say CSV_NAME. What I am getting is new folders with the name as CSV_NAME under which one .csv file is present with name as CSV_NAME.

 

What I need is that all my .csv files should be present under a single directory. Is that doable? Any pointers?

Best answer by erik_jan

CSV like Shape is a folder based dataset, which means a featuretype in this dataset is a file. So to generate files based on a attribute, you will need the featuretype fanout (a setting on the featuretype) as opposed to the dataset fanout that will generate folders.

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

david_r
Celebrity
  • July 8, 2013
Hi,

 

 

What is the value of CSV_NAME when it reaches the Writer?

 

 

Try sending the features to a Logger and have a look.

 

 

David

  • Author
  • July 8, 2013
The value is as expected say District1. Now, it creates a folder District1 with a csv file under it with name District1.

takashi
Influencer
  • July 8, 2013
Hi,

 

 

I guess you specified both of the "Fanout Dataset" parameter and the "Fanout By Attribute" parameter of the CSV writer. If so, cancel the "Fanout Dataset" parameter setting.

 

 

Takashi

  • Author
  • July 8, 2013
Thanks Takashi. That suggestion resolved the problem.

adamajm
Participant
  • Participant
  • December 9, 2015

Hi, I am having the same issue, but only for CSV. Below are screenshots of the settings. I don't see two different options as mentioned in the reply from 2 yrs ago about Fanout by Attribute vs. Fanout by Dataset. I only see Fanout by Dataset stting, then within that, option select what "attribute to fanout on." In my case, i'm trying to use the timestamp (probably a common use case) to publish stored copies of the written data.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • Best Answer
  • December 9, 2015

CSV like Shape is a folder based dataset, which means a featuretype in this dataset is a file. So to generate files based on a attribute, you will need the featuretype fanout (a setting on the featuretype) as opposed to the dataset fanout that will generate folders.


roland.martin
Forum|alt.badge.img+9
adamajm wrote:

Hi, I am having the same issue, but only for CSV. Below are screenshots of the settings. I don't see two different options as mentioned in the reply from 2 yrs ago about Fanout by Attribute vs. Fanout by Dataset. I only see Fanout by Dataset stting, then within that, option select what "attribute to fanout on." In my case, i'm trying to use the timestamp (probably a common use case) to publish stored copies of the written data.

Hi Adam,

You're looking at the Dataset Fanout settings. For Feature Type Fanout, you need to look in the Feature Type Properties, and just set the file/layer name to an attribute value - something like the image below.

There's also more info here...


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings