Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

Dynamic Input Error

Highlighted
6 - Meteoroid

Hi, 

 

I am using the Dynamic Input tool to read multiple CSV files into my workflow; however, there are some files that create an error due to "a field was missing a closing quote in record...". Once that error occurs, it stops reading any further CSV files. 

 

I'm wondering, is it possible to change the settings so that it ignores that error and continues to read the remaining lines of the CSV file, along with any other CSV files that come after it?

 

Thanks in advance!!

 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @lmosher 

 

I think that would be the case you should use a Batch Macro to read these files. 

 

In the Batch Macro you can actually give a special treatment to each of these cases of corrupted schema - you could even set something to skip these files.

There are some articles that explain this method

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Batch-Macro-Output-into-Multiple-Files...

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-To-Import-Multiple-Excel-Sheets...

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Read-in-Multiple-Excel-Files-with-M...

 

Cheers,

Highlighted
6 - Meteoroid

Hi @Thableaus

 

Thanks for your prompt response!

 

Here's what I've got so far per your suggestion. I've never used the Batch Macros before, so I'm not entirely sure how to progress from here. 

 

One of the links you posted talked about changing the names of the input; my issue deals with a single line in the CSV file that doesn't have a closing quotation. How do you go about setting the macro to skip the lines in the file with the corrupted schema?

 

lmosher_0-1573835473213.png

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@lmosher 

 

In this case you don't use the Dynamic Input.

 

The macro needs to be built separately from where you're going to insert the File Paths (from the Directory Tool).

 

I will get you an example later, but if you carefully read the articles I posted, you will figure this out.

 

Cheers,

Highlighted
10 - Fireball

Using the "Text to Columns" tool is a lot more flexible than the "Input" tool, and then you can filter out the bad data and try to fix it.

 

Double Read the CSV file.jpg

In the "Input" tool you set the delimiter to "\0" for no delimiter, and in the "Text to Columns" tool you put in your real delimiter.

 

The "Input" tools configuration window:

Read in with no Delminter.jpg

 

The "Text to Columns" tools configuration window:

Text to Columns Tool.jpg

Highlighted
6 - Meteoroid

@Darryl5280 this works perfectly! Thanks for the solution!!

Labels