<?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>MemoSoup &#187; file</title>
	<atom:link href="http://www.memosoup.com/tag/file/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>VBA: how to read text file</title>
		<link>http://www.memosoup.com/20120205/vba-how-to-read-text-file.html</link>
		<comments>http://www.memosoup.com/20120205/vba-how-to-read-text-file.html#comments</comments>
		<pubDate>Sat, 04 Feb 2012 23:55:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VB]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=461</guid>
		<description><![CDATA[<p>This is just example, how to read text file in Visual Basic for Applications (for example, in Excel macro). </p> <p>It&#8217;s just a stub: there is no error processing here, the source file is really text file, no problems with permissions etc.</p> Sub read_from_text_file() txtFile = Application.GetOpenFilename(&#34;Text Files (*.txt), *.txt&#34;) If txtFile = False Then [...]]]></description>
			<content:encoded><![CDATA[<p>This is just example, how to read text file in Visual Basic for Applications (for example, in Excel macro). </p>
<p>It&#8217;s just a stub: there is no error processing here, the source file is really text file, no problems with permissions etc.</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #E56717; font-weight: bold;">Sub</span> read_from_text_file()<br />
<br />
txtFile = Application.GetOpenFilename(<span style="color: #800000;">&quot;Text Files (*.txt), *.txt&quot;</span>)<br />
<span style="color: #8D38C9; font-weight: bold;">If</span> txtFile = <span style="color: #00C2FF; font-weight: bold;">False</span> <span style="color: #8D38C9; font-weight: bold;">Then</span><br />
&nbsp; &nbsp; MsgBox <span style="color: #800000;">&quot;No file to process&quot;</span><br />
&nbsp; &nbsp; <span style="color: #E56717; font-weight: bold;">Exit</span> <span style="color: #E56717; font-weight: bold;">Sub</span><br />
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span><br />
<br />
<span style="color: #151B8D; font-weight: bold;">Open</span> txtFile <span style="color: #8D38C9; font-weight: bold;">For</span> <span style="color: #151B8D; font-weight: bold;">Input</span> <span style="color: #151B8D; font-weight: bold;">As</span> #1<br />
&nbsp; &nbsp; &nbsp; <span style="color: #151B8D; font-weight: bold;">Input</span> #1, myString<br />
&nbsp; &nbsp; &nbsp; MsgBox myString<br />
<span style="color: #8D38C9; font-weight: bold;">Close</span> #1<br />
&nbsp; &nbsp;<br />
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></div></div>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20120205%2Fvba-how-to-read-text-file.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20120205/vba-how-to-read-text-file.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="VBA: how to read text file" data-url="http://www.memosoup.com/20120205/vba-how-to-read-text-file.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20120205/vba-how-to-read-text-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl: get file checksum</title>
		<link>http://www.memosoup.com/20100608/perl-get-file-checksum.html</link>
		<comments>http://www.memosoup.com/20100608/perl-get-file-checksum.html#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:12:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[md5]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=286</guid>
		<description><![CDATA[use Digest::MD5; use IO::File; my $chk = Digest::MD5-&#62;new&#40;&#41;; foreach my $file &#40;@ARGV&#41; &#123; &#160; &#160; $chk-&#62;addfile&#40;IO::File-&#62;new&#40;$file&#41;&#41;; &#160; &#160; print &#34;$file -&#62; &#34;,$chk-&#62;hexdigest,&#34;\n&#34;; &#125; <p>The additional details could be found on IBM site</p> Tweet news and informations&#160;automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">use</span> Digest<span style="color: #339933;">::</span><span style="color: #006600;">MD5</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">File</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$chk</span> <span style="color: #339933;">=</span> Digest<span style="color: #339933;">::</span><span style="color: #006600;">MD5</span><span style="color: #339933;">-&gt;</span><span style="color: #000000; font-weight: bold;">new</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #000000; font-weight: bold;">ARGV</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$chk</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">addfile</span><span style="color: #009900;">&#40;</span>IO<span style="color: #339933;">::</span><span style="color: #006600;">File</span><span style="color: #339933;">-&gt;</span><span style="color: #000000; font-weight: bold;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$file -&gt; &quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$chk</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">hexdigest</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>The additional details could be found on <a href="http://www.ibm.com/developerworks/aix/library/au-satsystemvalidity/index.html?S_TACT=105AGX99">IBM site</a></p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20100608%2Fperl-get-file-checksum.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20100608/perl-get-file-checksum.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Perl: get file checksum" data-url="http://www.memosoup.com/20100608/perl-get-file-checksum.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20100608/perl-get-file-checksum.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle: file needs recovery (offline mode)</title>
		<link>http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html</link>
		<comments>http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html#comments</comments>
		<pubDate>Thu, 01 Oct 2009 11:00:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[recover]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=188</guid>
		<description><![CDATA[select d.file# f#, d.name, d.status, h.status from v$datafile d, v$datafile_header h where d.file# = h.file# and &#40;d.status not in &#40;'SYSTEM','ONLINE'&#41; or h.status != 'ONLINE' &#41;; <p>If there are such files, the recovery is necessary:</p> restore the file from the backup recover datafile &#8216;&#038;the_file_name&#8217; ; alter database datafile &#8216;&#038;the_file_name&#8217; online; <p>Another possibility (if there are a [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">select</span> d.<span style="color: #0000FF;">file</span># f#, d.<span style="color: #202020;">name</span>, d.<span style="color: #202020;">status</span>, h.<span style="color: #202020;">status</span><br />
<span style="color: #0000FF;">from</span> v$datafile d, v$datafile_header h<br />
<span style="color: #0000FF;">where</span> d.<span style="color: #0000FF;">file</span># <span style="color: #808080;">=</span> h.<span style="color: #0000FF;">file</span>#<br />
and <span style="color: #808080;">&#40;</span>d.<span style="color: #202020;">status</span> not in <span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'SYSTEM'</span>,<span style="color: #FF0000;">'ONLINE'</span><span style="color: #808080;">&#41;</span> or h.<span style="color: #202020;">status</span> <span style="color: #808080;">!=</span> <span style="color: #FF0000;">'ONLINE'</span> <span style="color: #808080;">&#41;</span>;</div></div>
<p>If there are such files, the recovery is necessary:</p>
<ol>
<li>restore the file from the backup</li>
<li>recover datafile &#8216;&#038;the_file_name&#8217; ;</li>
<li>alter database datafile &#8216;&#038;the_file_name&#8217; online;</li>
</ol>
<p>Another possibility (if there are a lot of files):</p>
<ol>
<li>restore the files from the backup</li>
<li>recover tablespace &#8216;&#038;tbs_name&#8217; ;</li>
<li>alter tablespace &#8216;&#038;tbs_name&#8217; online;</li>
</ol>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20091001%2Foracle-file-needs-recovery-offline-mode.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Oracle: file needs recovery (offline mode)" data-url="http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20091001/oracle-file-needs-recovery-offline-mode.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix: get the file date</title>
		<link>http://www.memosoup.com/20090918/unix-get-the-file-date.html</link>
		<comments>http://www.memosoup.com/20090918/unix-get-the-file-date.html#comments</comments>
		<pubDate>Fri, 18 Sep 2009 15:08:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=132</guid>
		<description><![CDATA[ls -1 &#124; cpio -o &#124; cpio -ivt &#124; awk '{print $NF, $(NF-1), $(NF-4), $(NF-3) }' <p>Warning: I/O expensive for the large files!</p> <p>Perl:</p> @a = localtime&#40;&#40;stat&#40;$my_file&#41;&#41;&#91;9&#93;&#41;; $a&#91;4&#93;++; printf &#34;%02d%02d%02d&#34;,@a&#91;5,4,3&#93;; Tweet news and informations&#160;automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cpio</span> <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cpio</span> <span style="color: #660033;">-ivt</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF, $(NF-1), $(NF-4), $(NF-3) }'</span></div></div>
<p><strong>Warning: </strong>I/O expensive for the large files!</p>
<p><strong>Perl:</strong></p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">@a</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/localtime.html"><span style="color: #000066;">localtime</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://perldoc.perl.org/functions/stat.html"><span style="color: #000066;">stat</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$my_file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span><br />
<a href="http://perldoc.perl.org/functions/printf.html"><span style="color: #000066;">printf</span></a> <span style="color: #ff0000;">&quot;%02d%02d%02d&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@a</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></div>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20090918%2Funix-get-the-file-date.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20090918/unix-get-the-file-date.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Unix: get the file date" data-url="http://www.memosoup.com/20090918/unix-get-the-file-date.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090918/unix-get-the-file-date.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

