I have file which has following format
----------------------------------------
  Name: cust foo
  mail: [email protected]
  Account Lock: FALSE
  Last Password Change: 20170721085748Z
----------------------------------------
  Name: cust xyz
  mail: [email protected]
  Account Lock: TRUE
  Last Password Change: 20181210131249Z
----------------------------------------
  Name: cust bar
  mail: [email protected]
  Account Lock: FALSE
  Last Password Change: 20170412190854Z
----------------------------------------
  Name: cust abc
  mail: [email protected]
  Account Lock: FALSE
  Last Password Change: 20191030080405Z
----------------------------------------
I want to change Last Password Change data format to YYYY-MM-DD but not sure how to do that with sed or awk or is there any other method, I can try for loop it and use date -d option but not sure if there is easier way to do with regex





date -dwill be the most robust solution and likely the most simple solution as well