Friday, September 02, 2005

Text Massage

Sigh. I am so obsolete. Today I wanted to massage some text on windows. Didn't know how to do it the quick and dirty way, as usual, had to telnet into a unix box to do it in shell. Trusty old shell scripts never fails me in times of desperation. Here's my quick and dirty script, to list each line and add a before and after string of text.

for I in `cat p.txt`; do
echo " <servlet-mapping>"
echo " <servlet-name>${I}</servlet-name>"
echo " <url-pattern>/${I}</url-pattern>"
echo " </servlet-mapping>"
echo
done


I wonder if there are any easy to use windows applications out there, that can do the same. Hmm come to think about.. I just recalled that I could do it with Excel's VBScript. Yeah!.. heh heh. But then again, that would mean having to open Excel.

The thing is, these days my stoopid machine is taking forever to open files, something about WinXP's persistent drive? Have yet to find a solution. So telnet is faster.. thus the scripting.

Yeah TGIF! DOTA session in .. perhaps in an hour? Whee... owning.. or be owned :((


0 Comments:

Post a Comment

<< Home