Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-Changing file name in Script file on Run 1

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
Hello I have a script fiel that runs and collects data from a switch. the data is parsed into various Text files.

My questions is how can I cange the name of the file every time I run the script. Example:

string SwitchID = "Site Id.txt"
string ListATC = "ATC.txt"
string ListATC_G = "ATC_G.txt"
sdlginput "Account" "Enter Acct Num:" sAcctNum

I want to change to have sAcctNum added to the beginning of the File Names.

Any ideas

Your assistance and Guidance will be appreciated
 
You can use the strfmt command to create a filename from the various component pieces, such as the base filename (maybe ATC.txt in your example) and the value entered by the user in the sAcctNum variable. It would look something like this:

strfmt sFileName "%s_%s" sAcctNum ListATC

would result sFileName having a value of nnn_ATC.txt where nnn would be the account number entered by the user.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top