I need help writing Perl code to replace some selected values ββin text files. Below is a sample of my text files. I want to replace the "end" value with a new value in the date format YYYYMMDD, increase the key value by 1, and the rest will remain the same.
Original file:
server=host1
network=eth0
start=YYYYMMDD
end=YYYYMMDD
key=34
If I changed the value of "end" to yyyymmdd (new date) and the "key" to +1. output should be:
server=host1
network=eth0
start=YYYYMMDD
end=yyyymmdd
key=35
Please suggest a solution for this.
source
share