lcFile=yourfile lcTekst=filetostr(lcFile) lnStartBad = position of first byte to be removed lcTekst = STUFF(lcTekst,lnStartbad,30,"") strtofile(lcFile,left(lcTekst,lnLength-30))>
FUNCTION glopt clear lcTekst="aaaaaaaaaabbbd1111111111rrrd2222222222rrrd3333333333rrrd4444444444rrr" && filetostr(lcFile) && a = header bytes && b = bad header bytes to be removed && d = record delete byte && 1,2,3,4 data bytes for the record && r = extra bytes to be removed from data records lnDataByte = 14 lnRecLen = 14 && Record Length delete byte 10 data bytes 3 bytes to remove lnRecCount = 4 && Record Count lnDelBytes = 3 &&Number of bytes per record to delete FOR I = lnRecCount TO 1 STEP -1 lnStartByte = lnDataByte + lnReclen*(I-1) + (lnReclen-lnDelbytes) lcTekst = STUFF(lcTekst,lnStartByte,lnDelBytes,"") ENDFOR lnStartBad = 11 && position of first byte to be removed lnHeaderBad = 3 && Number of bytes to remove from header lcTekst = STUFF(lcTekst,lnStartBad,lnHeaderBad,"") return lcTekstI'm assuming here that the header record has the correct record count, record length, etc. and that the actual file doesn't reflect what the header shows. If not, at least I had some fun writing it.