My young brother mentioned a problem he has trying to get an ebook into a form that he could read on a gadget that he goes on holidays with that was full of "<blockquote>" "</blockquote>" formatting but the problem was the two files were about 300 meg and 400 meg. Noting that he was running 32 bit XP, I was not sure he had enough free memory to do the task but spat together a quick scruffy that actually did the job if only just. Did the first file OK but shoved a lot out to virtual memory and was very slow for the second file.
One of the reasons why I am a great fan of PBCC is the capacity to pelt a scruffy together in under 5 minutes, run it once then forget it.
One of the reasons why I am a great fan of PBCC is the capacity to pelt a scruffy together in under 5 minutes, run it once then forget it.
Code:
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ FUNCTION PBmain as LONG LOCAL flen as DWORD ' -------------------------------------- StdOut "Opening file p1.txt" Open "p1.txt" for Binary as #1 flen = lof(1) Get$ #1, flen, a$ Close #1 StdOut "stripping <blockquote>" a$ = remove$(a$,"<blockquote>") StdOut "stripping </blockquote>" a$ = remove$(a$,"</blockquote>") StdOut "writing result to disk" Open "rslt1.txt" for Output as #1 Print #1, a$; Close #1 ' -------------------------------------- a$ = "" ' -------------------------------------- StdOut "Opening file p2.txt" Open "p2.txt" for Binary as #1 flen = lof(1) Get$ #1, flen, a$ Close #1 StdOut "stripping <blockquote>" a$ = remove$(a$,"<blockquote>") StdOut "stripping </blockquote>" a$ = remove$(a$,"</blockquote>") StdOut "writing result to disk" Open "rslt2.txt" for Output as #1 Print #1, a$; Close #1 ' -------------------------------------- Stdout "Done !, Press any key to exit." waitkey$ End FUNCTION ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Comment