ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

SOLVED: Easy use of a variable to edit a php (text) file in a batch file

(1/1)

questorfla:
Not sure where I am missing something . It may be that editing a .php" file doesn't the same rules as a .txt file but i am using a text editor to modify manually.
the file "config.php" need for line 3 which states :   $directory   = "directory";   .  to change the word in quotes to the value of %inputb%.  Once that is done, the config.php file is used to continue to creation of the folder.  That's about it. 
The prior operations would have loaded the correct value for the name "directory" into the variable %inputb%  I know inputb has the correct data in it as I can print it on screen with echo but I cannot get it to edit the config.php file as shown without exiting the batch which was the whole point in doing it :(
so that after building the layout it ends with that file modified to reflect the value of the variable at the time it was loaded.
The php file has 54 lines total and i only need to add the name of the directory in line 3.  I cant just use the variable itself because of other scripts that would use the same config file that would not provide the information for %inputb%

questorfla:
Whoops.  Sorry Skwire.  I may be in the wrong forum.

questorfla:
http://www.dostips.com/?t=Batch.FindAndReplace
>>Excellent bit of craftsmanship! <
Whew!  Finally found the answer and it even worked!  I just did not look hard enough. 

Skwire, can you please remove this whole thread or post somewhere if it might be of use to others.
Thanks
(I regret to say i do not know how to close or move one :(  )

Navigation

[0] Message Index

Go to full version