Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space.
Total length of record is 420. Here is the specification of the data in file.
Position Field Data Type
-----------------------------------------------------
1 Capital Letter total length = 1
2-6 Blanks
7-15 Numeric Data total length 9
16-19 Numeric Data total length 4
20-25 Year and Month.
26-31 Blanks
32 Character Data total length 1
33 Character Data total length 1
34-41 Blanks
42-43 Character Data total length 2
44-48 Blanks
49 Capital Letter total length = 1
50-89 Character total 39 length
90-129 Character total 39 length
130 Capital Letter total length = 1
131-170 Character Data total length 39
171-199 Alphabetic Data total length 29
200-201 Character Data total length 2
202-210 Numeric Data total length 5
211-219 Numeric Data total length 9
220-290 Character Data total length 60
291-330 Character Data total length 39
331-359 Alphabetic total length 29 character
360-361 Character Data total length 2
362-370 Numeric Data total length 5
371 Capital Letter total length = 1
372-420 Blanks
Any help on this will be appreciated. Thanks in advance.
Please use code tags when showing input and output strings. You say that the total record length of each of your input and output records is 413, but the three input records you have given us contain 152, 143, and 152 bytes, respectively (not counting the terminating <newline> character) and each of your three output records contain 143 bytes.
You also give two conflicting descriptions of what is in the 1st record.
Making a guess at what your input really looks like, the following may work: