Help swapping date and words

A swapping-ground for Regular Expression syntax

Help swapping date and words

Postby sdjeff » Mon Sep 17, 2018 6:46 pm

I am needing help with this one, I've tried a few things and it didn't work.

I have a about 2000+ files that are labeled in the format:
[word 1] [word 2] [word 3] [word 4] [digit] [date yyyy-mm-dd]

I need it changed to:
[word 1] [word 2] [word 3] [date yyyy-mm-dd] [word 4] [digit]

Note- the [digit] maybe 1, 2, 3 digits (1 to 100)

Example:
From-
ABC DEF GHI No 22 1971-04-13
To-
ABC DEF GHI 1971-04-13 No 22

Thanks for looking
sdjeff
 
Posts: 2
Joined: Mon Sep 17, 2018 6:29 pm

Re: Help swapping date and words

Postby sdjeff » Thu Sep 20, 2018 2:17 am

Well I got it by messing around:
Match: (.*) (.*) (.*) (.*) (.\d) (.*\d)
Replace: \1 \2 \3 \6 \4 \5

I found that I had numbering checked, which was screwing things up.
sdjeff
 
Posts: 2
Joined: Mon Sep 17, 2018 6:29 pm


Return to Regular Expressions