replacing ini content

17 views
Skip to first unread message

Chris Edwards

unread,
Sep 23, 2015, 12:42:50 PM9/23/15
to Ansible Project

I need to save a section from an ini file , copy a new version of the ini file and then replace the values.

for example

[config]
option1=value1
option2=value2
option3=value3

[locations]
location1=uk
location2=us


save the config section, copy new ini file resulting in

[config]
option4=value4
option5=value5
option6=value6

[locations]
location1=france
location2=china


then replacing the config section with the original, ending up with

[config]
option1=value1
option2=value2
option3=value3

[locations]
location1=france
location2=china

Reply all
Reply to author
Forward
0 new messages