<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unzip &#8211; SMsoft &#8211; informatica e dintorni</title>
	<atom:link href="https://blog.smsoft.it/tag/unzip/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.smsoft.it</link>
	<description>consigli settimanali su MacOS, GNU/Linux ed Open Source</description>
	<lastBuildDate>Tue, 05 Jun 2012 09:11:55 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=99942</generator>
	<item>
		<title>Cercare testo nei files .odt</title>
		<link>https://blog.smsoft.it/2012/06/05/cercare-testo-nei-files-odt/</link>
					<comments>https://blog.smsoft.it/2012/06/05/cercare-testo-nei-files-odt/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 05 Jun 2012 09:11:55 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[content.xml]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[odt]]></category>
		<category><![CDATA[unzip]]></category>
		<guid isPermaLink="false">http://blog.smsoft.it/?p=1800</guid>

					<description><![CDATA[Divese volte ho avuto la necessità di cercare testo nei files .odt. Fermo restando il fantastico Spotlight di OSX, volevo creare una piccola utility per bash, magari da usare velocemente. Il classico grep o zgrep non funzionano, anche se il file .odt è solo un archivio compresso con all&#8217;interno un file .xml con il testo ... <a title="Cercare testo nei files .odt" class="read-more" href="https://blog.smsoft.it/2012/06/05/cercare-testo-nei-files-odt/" aria-label="Per saperne di più su Cercare testo nei files .odt">Leggi tutto</a>]]></description>
										<content:encoded><![CDATA[<p>Divese volte ho avuto la necessità di cercare testo nei files .odt. Fermo restando il fantastico Spotlight di OSX, volevo creare una piccola utility per bash, magari da usare velocemente.<br />
Il classico grep o zgrep non funzionano, anche se il file .odt è solo un archivio compresso con all&#8217;interno un file .xml con il testo in chiaro. Ho scritto qualche riga di bash ed ecco quà una comoda utility da poter utilizzare:</p><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
#20120307 - a.aloni: cerca i file .otd che contengono una certa stringa

E_ERR_ARG=65
if [ -z "$1" ]
then
  echo "Utilizzo: `basename $0` stringa da cercare [eventuale cartella]"
  exit $E_ERR_ARG
fi

for file in $2*.odt;
  do unzip -p "$file" content.xml | grep -l $1 > /dev/null;
  if [ $? -eq 0 ];
    then echo "$file";
  fi;
done</pre><p></p>
<p>Basta inserire queste poche righe in un file, dargli i permessi di esecuzione ed il gioco è fatto.</p>
<p>enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2012/06/05/cercare-testo-nei-files-odt/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
