Created
July 29, 2014 12:58
-
-
Save RafiKueng/042b987c01acce4a50b4 to your computer and use it in GitHub Desktop.
I/O Demo for http://unix.stackexchange.com/a/145916/60298
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This input: | |
infile = ''' | |
key0=0 | |
key1=1 | |
key1 = 1 | |
key2=2 # comment1 | |
#key3=3 | |
#key4=4 | |
#key5=5 # comment | |
#key6=6 # comment | |
key7=7 | |
key8 = 8 | |
''' | |
# used with: | |
replacements = { | |
'key1' :'11repl', | |
'key2' :'22repl', | |
'key3' :'33repl', | |
'key4' :'44repl', | |
'key5' :'55repl', | |
'key6' :'66repl', | |
} | |
# lead to the following file: | |
key0=0 | |
key1=11repl | |
key1=11repl | |
key2=22repl# comment1 | |
#key3=3 | |
#key4=4 | |
#key5=5 # comment | |
#key6=6 # comment | |
key7=7 | |
key8= 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment