Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!

SOLVED

Can I transform an .xlsx file into a .txt file with a specific pattern?

Stanislaw
6 - Meteoroid

Hello guys,

 

Could you please help me with this?

Let's say I have an Excel table like this:

 

DateTeaCoffee
2020M113611
2020M123316

 

And I would like to create a txt output file that would look this way:

 

START_SERIES;

NAME: Tea;

DATE: 2020M11 # VALUE: 36

DATE: 2020M12 # VALUE: 33

END_SERIES;

 

START_SERIES;

NAME: Coffee;

DATE: 2020M11 # VALUE: 11

DATE: 2020M12 # VALUE: 16

END_SERIES;

 

Is it possible with Alteryx?

Thank you!

afv2688
15 - Aurora
15 - Aurora

Hello @Stanislaw ,

 

I've created a little batch macro that does the job 🙂

 

Untitled.png

 

If you need anything else let me know

 

Regards

Stanislaw
6 - Meteoroid

That's intense. 🙂

I'd need to spend some time to understand every step of this process, but now I have something to work with.

 

Thank you, afv2688, you rock!

Can this batch macro be run via Command Prompt in Windows? Or do I have to have Alteryx Designer opened?

 

Best,

S.

afv2688
15 - Aurora
15 - Aurora

Hello @Stanislaw ,

 

depending on your configuration you may be able to run your workflows using the command prompt on windows yes.

 

Using the following command you would be able to test it:

 

"C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe" "C:\yourworkflowpath\yourworkflow.yxmd"

 

To help you understand it, this workflow uses a batch macro to create the results. Using the input it will take all the names and filter to get the data corresponding to this specific product.

 

Then, file will be set up using your specifications (first start, then product, the dates and in the end the ending row)

 

Once it finishes it piles up every result it gets on the output, giving you everything together as desired.

 

On the output file I have selected '\0' since I don't want alteryx to set any delimeters for the csv file.

 

Hope this helps you understand it a little bit more 😉

 

Regards

Stanislaw
6 - Meteoroid

Hello @afv2688 

I have another question:

 

Is it possible to print in a txt file only selected concepts?

Let's say I have a file called SourceFile:

 

DateTeaMilkCoffeeBeer
2020M1136251115
2020M123301614

 

I also have a file called Map:

ConceptCode
TeaBEV001
CoffeeBEV002

 

I can use the Dynamic Rename tool

dynamicRename.jpg

 

And get something like this:

DateBEV001MilkBEV002Beer
2020M1136251115
2020M123301614

 

My question would be:

Can I print to txt file only the concepts from my map and skip the useless ones?

 

Thank you

afv2688
15 - Aurora
15 - Aurora

Hello @Stanislaw ,

 

You can perfectly do a rename and skip the ones you don't need. Check this workflow.

 

Regards

Labels