Skip to main content

I'm currently working on a task where I need to iterate through each CSV file found within specified folders and convert them to SHP files. My approach involves using the path to identify all files under the specified folder and then filtering them by extension using an attribute filter. However, when I use the FeatureReader to read the CSV files, it reads all the CSV files and combines them into one table.

I'm looking for guidance on how to set up a loop to iterate through the files one by one, rather than reading them all at once. Additionally, I've noticed that there are no columns shown in the visual preview, and I have to manually check all the columns in the column options to visualize them in the preview.

Is there a way to configure the table view/data schema in the FeatureReader to address these issues? Any advice or suggestions would be greatly appreciated. Thank you!

How I do this:

  • Creator to initiate process.
  • FeatureReader directory reader to find all CSV files.
    • Single output port.
    • AttributeExposer to expose path_windows.
  • FeatureReader CSV reader to read every CSV file found in the previous step.
    • Single output port.
    • Merge attributes.
  • AttributeExposer to expose attributes with coordinates.
  • Convert to geometry.
  • SchemaScanner to generate schema feature for each original CSV.
  • FeatureWriter to write shapes.
    • Dynamic writing based on schema feature.

How I do this:

  • Creator to initiate process.
  • FeatureReader directory reader to find all CSV files.
    • Single output port.
    • AttributeExposer to expose path_windows.
  • FeatureReader CSV reader to read every CSV file found in the previous step.
    • Single output port.
    • Merge attributes.
  • AttributeExposer to expose attributes with coordinates.
  • Convert to geometry.
  • SchemaScanner to generate schema feature for each original CSV.
  • FeatureWriter to write shapes.
    • Dynamic writing based on schema feature.

Great solution!


Reply