So i tried searching on google but found it difficult to say exactly what I was looking for.
Task - Capitalise x number of letters at the start of words.
eg. Original line - one.two.three.four
Revised line - One.Two.three.four (here only requiring 2 changes)
Test data:
Code:
wire.in.the.blood.s04e01.ws.pdtv.xvid-river.avi
wire.in.the.blood.s04e02.ws.pdtv.xvid-river.avi
wire.in.the.blood.s04e03.ws.pdtv.xvid-river.avi
wire.in.the.blood.s04e04.ws.pdtv.xvid-river.avi
Current code:
Code:
sed -r 's@(\b[a-z])@\u\1@' file
So this will change the first letter to be capitalised.
Adding a 'g' at the end will cause the first letter of every word on a boundary to be capitalised.
Adding a '4g' will process all words from fourth match to the end.
My task is to process all up until the fifth word on each line??
Code:
Wire.In.The.Blood.S04e01.ws.pdtv.xvid-river.avi
i know it will be simple but I am buggered if I can get it