I am suplying you the code that already works
and its independent of record size and file size.
But it is assumed to be used on unix machines.
If you need any more modifications I can do it for free.
here is the code
program file_delete_row
implicit none
C Copy right Vinay Boocha
C Address:
C 1692 brookdale rd, Naperville, IL , 60563
C Date: 7/29/2003
C Can be transeferable to the entity which buys the code
C under the agreement with Vinay Boocha.
call remove("word_file","exam")
end program file_delete_row
subroutine remove(file_name, word)
implicit none
Logical ex,ex2
character awk_command_string*100,file_name*(*),word*(*)
character temp_file*40, cmd*20,cmd1*20,cmd2*20
! Checking the existance of the file
inquire(file=file_name,exist=ex) ! Check that file existance
IF (ex) THEN
cmd = "awk '$0 !~ /"
cmd1= "/{print $0}' "
awk_command_string = cmd(1:12)//word//cmd1//file_name
! print*,'awk command',awk_command_string
call system(awk_command_string)
ELSE
print*,'Could not find the file passed'
ENDIF
end subroutine