Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Dynamic Input - File selection does not contain data, select a valid data file

Afournier
7 - Meteor

Hi everyone, 

 

Every day we receive data from a 3rd party and every month we use Alteryx to consolidate the data and seperate the required field (its a fix field lenght report). The 3rd party changed something in the data and now we are getting the error "File selection does not contain data, select valid data file". 

 

The change is the arrow in the data: 

arrow data.PNG

The arrow look like its doing a "page break" but im not 100% sure. In the dynamic input tool this is what we see:

data1.PNG

 

In the previous data that was working, we didnt see that arrow and the dynamic input flat file layout was showing everything on the same line. 

 

Here is a preview of the flow: 

Flow1.PNG

 

Thanks in advance for any help.

10 REPLIES 10
ChrisTX
16 - Nebula
16 - Nebula

Can you open the file with a text editor like Notepad++ ?

 

If yes, you can use the HEX editor to determine what the character is.

Afournier
7 - Meteor

In Notepad ++, this is what I see: 

G00000000300030532025100100025398 00000003500174712024100700000000 04020241007

data2.PNG

ChrisTX
16 - Nebula
16 - Nebula

Try the menu option Plugins > Converter > ASCII -> HEX

 

Then figure out where the character is in the HEX string and use Google to find the HEX code

Afournier
7 - Meteor

ok! So the HEX code is 0C

Form Feed

FF

Ctrl L

12

00001100

0C

 

So now is there a way I could replace/remove this when the input is not only one file but multiple files using the directory tool? 

ChrisTX
16 - Nebula
16 - Nebula

See attached workflow.

In the Dynamic Input tool, make sure you configure the Input Data Source Template correctly.  Specifically, Delimiter \0 and Field Length and "Output File Name as Field" and "First Row contains Field Names".

 

HEX 0C is a Form Feed character, decimal 12.  See https://www.commfront.com/pages/ascii-chart

 

Use this expression in a Formula tool to delete the Form Feed character:

Replace([Field_1], CharFromInt(12), "")

 

The Dynamic Input tool will perform a Union for all of the different files.

I'm guessing you've already configured the Directory tool and Dynamic Input.

If not, inside Alteryx Designer under the Developer category click the Dynamic Input tool then click Open Example.

 

After the Dynamic Input, use the Formula tool mentioned above to replace the Form Feed character in all files.

 

If you need to write the separate files back out, just use an Output Data tool and configure the option for Take File/Table Name From Field.

 

Chris

Afournier
7 - Meteor

Hi Chris, this is working very well! But now I figure out that for some reason the data we receive sometimes contain the HEX 0C character and sometime not... 

 

Is their any way this would work with or without the character? The data is all the same, the only difference between files is the HEX character. 

 

Thanks for your help 

apathetichell
19 - Altair

You need to dump Dynamic Input and switch to a batch macro. Dynamic Input will not work with two potential template files.

Afournier
7 - Meteor

Thanks, any suggestion for inspiration on the solution using a batch macro? 

ChrisTX
16 - Nebula
16 - Nebula

If there is a different character to be replaced, just add to the Formula tool

 

The workflow I posted will work if there is a file without the HEX 0C character.

Labels