How do I go about replacing/deleting the characters "2003" if they exist in field 1? The following cut command works assuming that all lines have 2003 as the 9th - 12th characters.
cut -c1-8,13-70 file
and
sed 's/2003 / /g'
Also works because there are 5 spaces between fields 1 and 2.
What is the best sed solution for performing this task?
Sample Input
Name Description
========================================================
tuesdayb2003 Tuesday wk1
tuesdays2003 2003 Tuesdays: Tuesdays w/oholiday
tuesfrid2003 2003 Tuesfrid: Tuesdays thru Fridays w/o
Desired Output
Name Description
========================================================
tuesdayb Tuesday wk1
tuesdays 2003 Tuesdays: Tuesdays w/oholiday
tuesfrid 2003 Tuesfrid: Tuesdays thru Fridays w/o
Any help would be greatly appreciated.
Thanks,
John
cut -c1-8,13-70 file
and
sed 's/2003 / /g'
Also works because there are 5 spaces between fields 1 and 2.
What is the best sed solution for performing this task?
Sample Input
Name Description
========================================================
tuesdayb2003 Tuesday wk1
tuesdays2003 2003 Tuesdays: Tuesdays w/oholiday
tuesfrid2003 2003 Tuesfrid: Tuesdays thru Fridays w/o
Desired Output
Name Description
========================================================
tuesdayb Tuesday wk1
tuesdays 2003 Tuesdays: Tuesdays w/oholiday
tuesfrid 2003 Tuesfrid: Tuesdays thru Fridays w/o
Any help would be greatly appreciated.
Thanks,
John