Hello,
I'm writing a sequential file that has a text on the 11th line (before that there're only line brakes). The thing is that after I write the file I'm loosing the ten first characters that I had on the original text. How can I write a direct access file and keep untouchable the original records that are right below the records that has been created?
Here is the code:
PROGRAM TEST
OPEN (UNIT=10, FILE='TEST.TXT', FORM='FORMATTED', ACCESS='DIRECT',
+STATUS='OLD', RECL=3)
DO N=0, 9, 1
WRITE (10,1, REC=N+1) N, CHAR(13), CHAR(10)
END DO
CLOSE(10)
PRINT *, CHAR(13), CHAR(10)
1 FORMAT(I1,2A1)
END
The file test.txt has a text on the 11th line and the 10th first characters are being replaced by the sequence
0
1
2
3
4
5
6
7
8
9
I'm writing a sequential file that has a text on the 11th line (before that there're only line brakes). The thing is that after I write the file I'm loosing the ten first characters that I had on the original text. How can I write a direct access file and keep untouchable the original records that are right below the records that has been created?
Here is the code:
PROGRAM TEST
OPEN (UNIT=10, FILE='TEST.TXT', FORM='FORMATTED', ACCESS='DIRECT',
+STATUS='OLD', RECL=3)
DO N=0, 9, 1
WRITE (10,1, REC=N+1) N, CHAR(13), CHAR(10)
END DO
CLOSE(10)
PRINT *, CHAR(13), CHAR(10)
1 FORMAT(I1,2A1)
END
The file test.txt has a text on the 11th line and the 10th first characters are being replaced by the sequence
0
1
2
3
4
5
6
7
8
9