cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rakesh_dama
Level 6

How to list the files in a directory and prompt user to select one and read the selected file

Hello Experts, I have a requirement, where I have multiple config files in a directory. And, our InstallAnywhere script should be able to real all the files in the directory and list them with index for user selection. Once user selects a config file, we should take that input and read the file in Linux environment. Do we have any plugins to help with this or can you suggest a way to do this. Thanks, Rakesh.
Labels (1)
0 Kudos
(5) Replies
Revenera_Ian
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi, rakesh_dama. Thank you for your post. You could try using the InstallAnywhere Properties File Reader Plugin Action in the online HelpNet documentation here: https://helpnet.flexerasoftware.com/installanywhere2018/roottopic.htm#helplibrary/ia_ref_plugins_propfilereader.htm Your config file needs to be in a key-value pair format, such as the following: MyTestKey=MyTestValue. I tested with a test config file, which was a plain text file: test.config. An InstallAnywhere variable $MyTestKey$ is initialized when the action reads the key-value pair from the config file. You could try resolving $MyTestKey$ with the syntax: $MyTestKey$. In my test, this resolved to: MyTestValue. Please give this a try. Does that work for you? Thanks, Flexera_Ian
0 Kudos

Hi Ian,

 

Thanks for your response. 

The requirement here is not to read config file. That I am doing anyway.

Requirement here is, read the filenames in a folder and prompt user to select a file from that folder.

example: I have a.config,b.config,c.config files in configs directory. I want to prompt user to select one config file among these from configs directory.

 

Thanks,

Rakesh.

0 Kudos

Hi Rakesh.,

You could try using the Choose File Panel. This will allow the user to select a file from a folder.

Thanks,

Ian

0 Kudos

Thanks Ian, Will give it a try and let you know.
0 Kudos

You're welcome, Rakesh. Sounds good. Thanks, Ian
0 Kudos