Blog Archive for January 11, 2013

XPath with JDom

January 11, 2013

I wanted to find a particular node in an XML document and extract data from it, using Java. I'm using jdom as my standard XML parser. The technology used for finding nodes in an XML document is XPath.

In my case I was looking for all the nodes in the …

Tags: jdom xpath

Adding Text to Lines in Vi

January 11, 2013

I wanted to add some text to the end of every line in a text document. This can be achieved in vi by doing a replace where the source string is simply $

This command typed into vi will add the word FOO to the end of every line:

:%s/$/FOO/g

Tags: vi vim