How can I automate within a script?

For example, A code takes input from the user for generating an output i.e., if I give a command 1 ,it generates a csv file and if i give command 2 it apply calculations to a file and again generates a csv file after processing the former csv file. So instead of giving manual responses to it, is it possible to automate such that as soon we begin the program it generates a the first csv file ,apply calculations and produces a message “First file has been generated” and with that as a trigger proceeds on its own to generate a File after performing calculations (second csv file)

I’m not completely sure if I got what your question is.

In general you can use condition statements like if or switch to check certain conditions and run code
or actions accordingly.

You write about the program, so if I understand correctly, it will be part of it?
If I’m right, function() with if or switch/case should do the trick :wink: