I do not know how to explain my problem, so I'll exemplify:
I am using PHP
and would like to manipulate a .txt file of n lines.
Each line has a default length of 20 characters.
For example ... the first 8 characters refer to a sending date (ddmmaaa), the 2 next to the source state (SP, RJ, ...), the other 2 to the destination state and the last 8 to product code.
Linha 1: 01012014RJPA00001472
Linha 2: 03121997MGRS00192010
...
Linha n: 28092012AMAC00000071
What I would like to know is how to overwrite one of these terms (not the entire line, not the whole file) and save the file.
Type: In line 2 of the file I want to change the source state from MG to MT without changing the other data in the file. As if I took the pointer to a position before the 'MG', I pressed the keyboard insert and typed 'MT'.