Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: remove a line binary
BoxOpen("Netscape Update","Searching") AddExtender("wsrch34I.dll") file="prefs.js" hand=srchInit("C:\",file,"","",16) while 1 a=srchNext(hand) if a=="" then break Buffer=BinaryAlloc(50000); more than enough for 7k file Line=BinaryIndexNc(Buffer,0,'user_pref("network.proxy.type", 1)',@FWDSCAN) ; gotta remove that line!!! and re-write the file... ; I hate mondays, my brain is not working today... endwhile srchFree(hand) exit
Buffer=BinaryAlloc(50000); more than enough for 7k file outbuf=BinaryAlloc(50000) userpref=BinaryIndexNc(Buffer,0,'user_pref("network.proxy.type", 1)',@FWDSCAN) BinaryCopy(outbuf,0,Buffer,0,userpref) cuthere=BinaryIndexNC(Buffer,userpref,@CRLF,@FWDSCAN)+2 a=BinaryEODGet(outbuf) b=BinaryEODGet(Buffer) BinaryCopy(outbuf,a,Buffer,cuthere,b-cuthere) BinaryWrite(outbuf,"TEST.XXX") BinaryFree(outbuf) BinaryFree(buffer)
Article ID: W12733
Filename: Remove Line from File.txt
File Created: 2001:03:01:15:00:58
Last Updated: 2001:03:01:15:00:58