Using awk and sed to convert error messages to something useful

This is mainly a post for myself, so that I don’t forget it.

I’m in the process of creating a ebook version of my new “Contributing to the Eclipse OS project” and I had lots of the following error message:

ERROR: /home/vogella/workspace/docu/de.vogella.publishing/../output/epub/book.epub: image file OEBPS/images/starteclipse10.png is missing

So I used ask to remove the beginning of the string: awk ‘/image/ { print $6 }’ matcher.txt > matcher2.txt
And sed to create a correct include statement for my ant build: sed ‘s/\(.*\)//’ matcher3.txt

I should really learn awk and sed at some point.

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, He is the primary author of With more than one million visitors per month this website is one of the central sources for Java, Eclipse and Android programming information.
This entry was posted in Other. Bookmark the permalink.