| View Blog
|
|
|
|
| Text Tools for Everyone |
Yesterday I wrote about the benefits of using plain ascii text files. Today, I'm going to tell you more about the tools I use in conjuction with text files. With these tools, they make working and living with plain text that much more productive. And that's the key to using text files. Being more productive at work and at home.
I subscribe to the GTD system and have adopted and adapted many of the principles in using my one giant text file for productivity and knowledge enhancement and collection. So for the benefit of you the reader I shall start with the most basic component, the text editor.
There are a vast number of text editors - many of them freeware or shareware and all have excellent properties and features. Just to name a few there is textpad, there is notepad++ and so on. I use in a windows environment Notetab lite as my editor of choice. It has buckets of features including tabbed multiple document support and support for different programming languages via it's clip books. But my choice text editor is VIM for vi improved. Coming from a Unix background I like vim and it's older brother vi. It's a command line text editor , although the Gnu VIM or gvim is windows based but still retains many of the command line features of vim/vi. This is an excellent text editor although it's arcane command structure will leave novices scratching their heads and wishing for notepad! It's well worth learning to use though. Once you've got past the initial learning curve it's a powerful editor and really does speed up text processing no end. Well that's my recommendations for text editing.
What about text processing and manipulation? Well for starters as I mentioned yesterday, I have installed on my windows laptop (it runs Xp but looks like vista - thanks to a nice program called vistamizer and another app called rocket dock - but that is another story again. Maybe I'll visit that in a later blog.) By choice I've added awk. I also added SED the stream editor but I think for the vast majority of people it would have no real use. Awk however has so many uses that it is difficult not to do with out it. Again, it takes a bit of learning, but once you have the basics you will agree that it's a very useful little application. I use awk to create the mini databases out of my text file. In the section I've set aside for contacts. I use the following format:
:PhoneBook:
bob jones|01923-765432|bob.jones@hotmail.com
barry smith|01255-444555|bsmith@yahoo.com
...
...
&&
And so on. The '&&' mark the end of the section for search purposes. A simple awk program for extracting a phone number from that list might go something like this
c:\>awk 'BEGIN{FS="|"}{print $1" "$2
On it's own this would just print out a list of names with their phone numbers, but combine this into a batch file and use a 'find' command for extra grep (sorry bad joke) and you produce a single line with the name and phone number you were looking for.
The batch file might look something like this:
@echo off
:: phone.bat
:: phone.bat is a simple batch file to obtain a name and phone number from
:: a telepone directory.
::-----------------------------------------------------------------------------------------------------
cls
echo ********************************
echo Phone Directory
echo ********************************
echo.
awk 'BEGIN{FS="|"}{print $1" "$2} ` c:\notebook.txt | find "%1"
This is not complete as I've not added a search function to search for the right section within the text file. But it would work much as I indicated in yesterdays post.
there are three other tools - all of them for text formatting. You can google for them. The first is AFT and the other is ReStructured Text (found with docutils). I must mention Lout which is a similar system but more advanced and uses a markup language (although greatly simplified) in a similar way to Tex or LaTex. It produces great documents from text but does require a bit more effort to learn. The advantage to these text formatters is that you spend more time on the content and the quality therein than how pretty it looks. For all of these you do need Perl and Python installed.
Using text files over any other type of file will allow you portability, flexibility, and greater freedom to get things done over the bloatware clogging up your PC.
Well 'nuff for today. I'm off to see how England are doing against the Aussies in the Ashes....I think it's evenly balanced at the moment but I am hoping that the the England bowlers can do a proper job and skittle out the Aussies soon!
|
|
Posted by ignominius on 2009-07-09 09:44:46 | Rating: | Views: 16
|
|
| |
|
|