Search code examples
regexvi

How to use regex to


I have txt file that contain some thing like this

How can i do this?


Solution

  • 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/