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:
The arrow look like its doing a "page break" but im not 100% sure. In the dynamic input tool this is what we see:
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:
Thanks in advance for any help.
Solved! Go to Solution.
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.
In Notepad ++, this is what I see:
G00000000300030532025100100025398 00000003500174712024100700000000 04020241007
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
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?
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
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
You need to dump Dynamic Input and switch to a batch macro. Dynamic Input will not work with two potential template files.
Thanks, any suggestion for inspiration on the solution using a batch macro?
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.