Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

upload dat-files through macro

dfrans
7 - Meteor

Hi,

 

I've created a flow to load and treat a .dat file.  Everything works fine (load as delimited) but when I want to run the flow through a batch macro - because I've got 50 files to handle - I get the message "unknown format".

 

Any ideas to avoid this?

 

Thanks,

Dirk

 

8 REPLIES 8
chris_love
12 - Quasar

Without seeing the macro or more details it's hard to diagnose - can you share any more details of the set-up or the actual macro you are using?


Chris

dfrans
7 - Meteor

Hi Chris,

 

It's a simple flow and macro as the ones attached.

If I test this, it works fine.

The difference with my actual flow is that it's isn't a csv-file but a dat-file.

When I create a normal flow to load a dat-file, although dat is not a supported file type, I works fine because I can make the necessary changes in the "resolve file type" window.  But when I convert that flow to a macro, the original flow (calling the macro) results in an error because .dat is an unknown file type.

So, the setup that I created to load and save the .dat in yxdb doesn't work anymore.

 

I'm sorry, because of confidentiality matters, I can't attach the original flows and files.

RodL
Alteryx Alumni (Retired)

The Dynamic Input tool should hold the format because you define it in the Template. (I've tested with .mit files which are also 'unknown' and it works.)

Based on what I see in your macro, it looks like you are just trying to take a set of .dat files and change into .yxdb files? An easy alternative to your batch macro would be to use a Directory tool with the Dynamic Input specifying to Output File Name, feed the data through, and the use an Output tool with the option to Append the File name to the output file. This will create separate output files for each input file you have.

 

If you want to really use a Batch Macro, then I would replace the Input tool in your macro with a Dynamic Input tool. Configure it for the .dat files and feed in a Text Input with the 'placeholder' file/folder name. Then direct your question to update the Text Input tool instead of the Input.

dfrans
7 - Meteor

Thanks for the reply.

I'll have a go with the "dynamic input tool".

 

The file that I've sent through is a simplified version.  I'm not just trying to convert the files to yxdb, there are a number of transactions that need to be done, I just took them out for the example.

 

Best regards,

Dirk

 

dfrans
7 - Meteor

One additional comment to this.

 

I need to load multiple files, but every file has a different structure.  I solved this with some additional steps in my flow but I believe that I will have to use a macro because every file needs to be treated differently.  Correct?

RodL
Alteryx Alumni (Retired)

Not sure what you mean by "every file has a different structure", but the Dynamic Input tool usually expects some consistency in the file format.

Hard to say without seeing it. I would assume if you have some logic to deal with the different formatting that is working, you could put that within the macro to have it take effect for each file.

 

dfrans
7 - Meteor

What I meant is that I have 50 dat-files, all of them having a different number of columns so different fields.

If I can get past the dat-problem - so loading 1 file via the macro - I can deal with the difference in structure.

RodL
Alteryx Alumni (Retired)

Then I think that should work.

Labels