Skip to content

Month: May 2010

substitution on a XML file shell script snippet

One more Shell script snippet.

Scenario: I have several directories, each one with a file called strings.xml. The problem with those files is that they are like:

"text"

I’d like to remove those double quotation marks inside the string element.

I’m already in the directory which contains all others directories with the xml files.

Solution: A script that for each directory, cat it xml file and substitute the occurrences of >” for > and “< for <.

for file in `ls`; do cat $file/strings.xml| sed ‘s/>”/>/g’| sed ‘s/” $file/strings.xml; done

Warning: Shell script and regular expressions are not the correct way to parse XML because there are special cases where you can not handle properly. But in simple cases like this one it can be useful.

palestra android

Essa quinta-feira, dia 6 de Maio de 2010, conversaremos sobre Android na palestra “Android: Visão Geral” a partir das 18:30 na Faculdade Evolução (R. Pedro I, 1276, no Centro). A ideia é falar por cima sobre o mercado mobile, o desenvolvimento Android, as possibilidades e os conceitos principais sobre suas aplicações.

Maiores detalhes sobre inscrição e a grade completa do evento:

Até lá.

Atualizado: slides que eu usei: