View Single Post
Old 01-24-2007, 01:26 AM   #2
mogui
eNigma
mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.mogui is no ebook tyro.
 
mogui's Avatar
 
Posts: 503
Karma: 1335
Join Date: Dec 2006
Location: The Philippines
Device: HTC G1 Android FBReader
cool idea -- a filter program

Thanks Puffball! You got me excited remembering my command-line days. Back when, I was able to cook up a filter program in C to do something like what you did with the QBASIC code. I have missed having that ability in Windows. I guess I am just too lazy to install a C compiler.

But I recently ran across WSH. That stands for Windows Scripting Host. You can read about it here: http://support.microsoft.com/kb/232211 Basically it allows you to create Visual Basic scripts ".vbs" and javascripts ".js" and simply execute them as programs at the command line. You can also drag the file to the desktop as a shortcut and execute it directly. I am using Windows XP Pro. It has WSH already installed.

This: http://www.jsware.net/jsware/scripts.php3 site is a good source of scripts. I downloaded a small set of text-manipulation vb scripts. Attached here is one that filters text. You must rename it to eliminate the ".txt" extension. Then you can modify it as you wish. Beware that it will overwrite your input file.

This: http://www.devguru.com/Technologies/...ipt_intro.html link will tell you everything you might wish to know about vbscript.

Now we can deal with some of the annoyances we find in text files. I recently used Mozilla Composer to export an html ebook as a text file. I found it had many non-ASCII characters in it that confused the MP4 player I use for reading. I spent much time using macros in an emacs editor to replace the odd characters and to reformat the text to my liking.

Best WSHes.
Attached Files
File Type: txt Replace.vbs.txt (1.2 KB, 360 views)

Last edited by mogui; 01-24-2007 at 03:54 AM.
mogui is offline   Reply With Quote