Thread: How to use python to split master text file into multiple files
conf.text contain following data:
configfile:"/var/etc/config/config.server"
rrrrrrrrrrrrrr
ffffffffffffffff
nnnnnnnnnnnnnn
configfile:"/var/config/myconf.cfg"
kkkkkkkkkkkkkkkk
mmmmmmmmmmm
llllllllllllllllll
configfile:"/var/etc/dbconfig/dbcon.conf"
aaaaaaaaaaaaaa
bbbbbbbbbbbbbbbb
cccccccccccccc
how use phyton function split conf.txt file multiple files using "configfile" tag spliting string , quoted string come after tag path , filename splitted sections stored.
i.e
lines
rrrrrrrrrrrrrr
ffffffffffffffff
nnnnnnnnnnnnnn
stored in "/var/etc/config/config.server"
and
kkkkkkkkkkkkkkkk
mmmmmmmmmmm
llllllllllllllllll
stored in : "/var/config/myconf.cfg"
and
aaaaaaaaaaaaaa
bbbbbbbbbbbbbbbb
cccccccccccccc
stored in : "/var/etc/dbconfig/dbcon.conf"
ps: master conf.text can contain more 3 sections mentioned above.so more configfile tag more config files after splitting process.
best regards.
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [other] How to use python to split master text file into multiple files
Ubuntu
Comments
Post a Comment