Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Creating Batch File to Remove Sheetname

KamenRider
11 - Bolide

Hi guys,

 

I would like to ask your help if you could create a batch file (autoexec.bat) deleting a specified sheet name. The directory of the file in located in the network drive. The filename for example is rename and delete.xlsx. Kindly also show how I can incorporate with the workflow.

 

Thanks,

Kamen

 

13 REPLIES 13
aatalai
14 - Magnetar

@KamenRider have you got the workflow to delete files (in a non batch macro already e.g. using C/python)?

Raj
15 - Aurora
KamenRider
11 - Bolide

HI @Raj  and @aatalai 

 

It is not the file that I would like to delete but rather the sheet tab or sheet name of the excel file. Any ideas? I was thinking a batch file would do the charm.

 

Hope to hear from you guys,

 

Kamen

Raj
15 - Aurora

@KamenRider  follow this.
Read Excel File:

Drag an "Input Data" tool onto the canvas.
Configure it to read the Excel file from the network drive (rename and delete.xlsx).
Filter Out Specified Sheet:

Drag a "Filter" tool onto the canvas.
Connect it to the "Input Data" tool.
Configure the filter to exclude the specified sheet name.
Write Excel File:

Drag an "Output Data" tool onto the canvas.
Connect it to the "Filter" tool.
Configure it to write the filtered data to a new Excel file.

KamenRider
11 - Bolide

Hi @Raj 

 

Thanks for the response. I forgot to tell you that the excel file is formatted. I believe I have seen this flow wherein the results is unformatted. I am correct, right? Need to preserve the formatted part.

 

Please advise.

 

Thanks,

Kamen

Raj
15 - Aurora

@KamenRider try using blob tools. It will help you to preserve the format..

HomesickSurfer
12 - Quasar

Hi @KamenRider 

 

Would it suffice or be better if the specific sheet contents be cleared (overwritten) and replaced with a comment and timestamp?

 

Capture.PNG

KamenRider
11 - Bolide

Hi @Raj

 

I am having error with blob. Also, will that include removing the other sheet name? Can you share me a workflow please...Just to explain the process I am doing in order for you to have a view of what I am doing.

 

1. copy the file from shared drive to destination shared drive

2. remove/delete the old file from destination shared drive which will be replace by a new one.

3. rename the formatted file

4. remove the sheet2 from the formatted file

5. connect it to another file to make it one file.

 

Thanks,

Kamen

KamenRider
11 - Bolide

HI @HomesickSurfer 

 

Sorry but what to you mean? Are you saying to replace the contents with a comment and timestamp? The objectives is to remove sheet2 or the second worksheet in the excel.

 

Please advise,

Kamen

 

Labels