This is what I have
FINPXXX
FOLLOWS FINPJOB99
CALENDAR1 FINP456
CALENDAR2 FINP374
CALENDAR3 FINPOE9
End result I want is
FINPXXX
FOLLOWS FINPJOB99
CALENDAR1 FIND456
CALENDAR2 FIND374
CALENDAR3 FINDOE9
I have 3 commands
sed 's/CALENDAR1 FINP/CALENDAR1 FIND/g'
sed 's/CALENDAR2 FINP/CALENDAR2 FIND/g'
sed 's/CALENDAR3 FINP/CALENDAR3 FIND/g'
I cannot just do sed 's/FINP/FIND/g' because there are a lot of 'FINP' pattern in the file I need to keep.
The problem I have is I have a lot of files, and I have to go thru each file to find out how many CALENDAR# pattern I have. Is there a better way to do the sed command? I tried this
sed 's/CALENDAR. FINP/CALENDAR. FIND' But it replaces all CALENDAR# to CALENDAR.
Thank you.