kristoff Posted July 2, 2004 Share Posted July 2, 2004 Hi everybody, I'm currently working on a project to deploy an aplication to dedicated targets located in txt file. Once the software is pushed to the server, I have to modify the unattended file. The problem, is that the line order can't be changed, if it is, the application is stucked. Using iniwrite will append at the end of each ection. For instance, I need to change the line #30 (servename=Default to servername=StringLower(@ComputerName) ), that's ok but not at line 30 If someone can point me or help me to sort out this, I'll be grateful !! TIA gang Link to comment Share on other sites More sharing options...
pekster Posted July 2, 2004 Share Posted July 2, 2004 Instead of using the IniWrite command, try reading it as a standard file using FileRead or the UDF to read a file into an array (each line as an element.) You could do that, search for the ini section, then key you're looking for. Change that element of the array, and then write the file back from your modified array. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
trids Posted July 3, 2004 Share Posted July 3, 2004 (edited) Using iniwrite will append at the end of each ection... this is true only if the key does not already exist. If the key exists already, then the line is updated wherever it is .. try this and you'll see that the position of key01 doesn't change with the second assignment:INIwrite("_xxx.ini","section","key01","aaaaa") INIwrite("_xxx.ini","section","key02","aaaaa") INIwrite("_xxx.ini","section","key03","aaaaa") INIwrite("_xxx.ini","section","key01","bbbbb");--> key01 stays where it is exit HTH Edit: elucidation Edited July 3, 2004 by trids Link to comment Share on other sites More sharing options...
kristoff Posted July 12, 2004 Author Share Posted July 12, 2004 Hmmm !! True ;-) My errors was ...I was deleted the line before updating it !! Sometime I'm wrong...I don't why Cheers men Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now