-2

I have txt file that contain some thing like this

How can i do this?

YZY
  • 47
  • 1
  • 7
  • 1
    Any particular reason you want to reintroduce the Y2K bug in the very year it caused [Lloyd's online banking to crash](https://www.theregister.com/2020/01/02/lloyds_outage/)? What are those dates? 1902? 0002? Why would you assume they are 2002? – Panagiotis Kanavos Oct 29 '20 at 17:24

1 Answers1

0

Something like this should do it, you want to essentially capture all values and rearrange them:

:%s/(\d+)-(\d+)-\d{2}(\d+)\s+(\d+)-(\d+)-\d{2}(\d+)/\3-\1-\2 \6-\4-\5/
Blindy
  • 65,249
  • 10
  • 91
  • 131
  • 1
    This answer is extremely dangerous without a pretty big warning that this reintroduces the Y2K bug. This fiasco [was the big IT news before COVID](https://www.theregister.com/2020/01/02/lloyds_outage/) – Panagiotis Kanavos Oct 29 '20 at 17:26