Substitute particular char in a file

I have a file like this.

1 aaa bcd  1 56 xyz 1
2 ccc  rrr   1 25  512 1
1 zaz eee   1 55  511 1

I want to change middle 1's ie after bcd,rrr,eee to 0 where as other 1's
should not change.
Can you please provide a solution .

awk '$1 ~ /^(bcd|rrr|eee)$/ { $4=0 } 1' inputfile > outputfile

Thanks.
But the file is big one having 5000 records. I want to change only 154 th
char where the file is having 306 chars.

I'm lost. If you have a file with 5000 records, how can the file contain only 306 characters???

Are you saying that each record in your file has a fixed length of 306 characters (or bytes) and that you want to change the character in character position 154 from 1 to 0 if the "word" before that position is one of the three strings you specified in post #1?

Note that the sample input you provided does not have a total of 306 characters, does not have 306 character lines, does not have fixed length lines (records), and does not have the 1 that you want to change in a fixed position.

Are you just looking for a single character 1 following one of your three specified strings? Or, does it have to be a 1 followed by a <space> (so multi-digit numbers starting with a 1 as the 1st digit would not changed to have a leading 0 )?

Do the varying numbers of <space> characters between fields in your lines have to be maintained? Or can strings of multiple adjacent <space>s be coalesced into a single <space>?

Is the 1 you want to change always the 4th field and the strings you are looking for always the 3rd field in a line (as in your sample input)?

The file has 5000 records.
Each record has 306 chars.All records have fixed length.
At 154 th char if it is 1 it should be changed to 0. Otherwise no change.
This is the problem, Can you please provide a solution.

Can you please provide a small representative sample input file (containing some records that should be changed and some that should not) and also provide the exact output file that you want to produce from that input?

Are the three strings that you're looking for in a record also in a fixed position within the record? If so, in what three character positions do they appear? (They aren't in a fixed position in the sample you provided in post #1; but neither was the 1 that you want to change to a 0 .)

What, if anything, delimits records in your file? For example, is a record composed of 305 non-<newline> characters and a <newline> record terminator?