Page 1 of 1

Adding a prefix?

Posted: Sat Aug 03, 2019 2:11 pm
by terrypin
I suspect I've forgotten some basic option...

How would I get data like this

1: Tuesday 2nd July, 2019
2: Wednesday 3rd July, 2019
3: Thursday 4th July, 2019
.
.
11: Friday 12th July, 2019
12: Saturday 13th July, 2019



converted to this please?

Day 1: Tuesday 2nd July, 2019
Day 2: Wednesday 3rd July, 2019
Day 3: Thursday 4th July, 2019
.
.
Day 11: Friday 12th July, 2019
Day 12: Saturday 13th July, 2019

If it matters, the Day number would never exceed 99.

Terry, East Grinstead, UK

Posted: Sat Aug 03, 2019 4:07 pm
by MudGuard
are there lines in the file that don't need the prefix?

If not, search for

Code: Select all

^
and replace with

Code: Select all

Day_
Otherwise, search for

Code: Select all

^\d+:_(?:Mon|Tues|Wednes|Thurs|Satur|Sun)day
and replace with

Code: Select all

Day:_$0
(_ should be a space)

Posted: Sun Aug 04, 2019 10:42 am
by terrypin
Many thanks, that works a treat!

I hadn't realised that ^ could be used in that solo fashion.

Terry, East Grinstead, UK