<?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>Pario TechnoBlob &#187; csv</title>
	<atom:link href="http://pario.no/tag/csv/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simple Windows Print Accounting using Event Viewer data</title>
		<link>http://pario.no/2009/05/15/simple-windows-print-accounting-using-event-viewer-data/</link>
		<comments>http://pario.no/2009/05/15/simple-windows-print-accounting-using-event-viewer-data/#comments</comments>
		<pubDate>Fri, 15 May 2009 06:40:35 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[Event Properties]]></category>
		<category><![CDATA[Event Viewer]]></category>
		<category><![CDATA[eventquery.vbs]]></category>

		<guid isPermaLink="false">http://pario.no/?p=1034</guid>
		<description><![CDATA[This post continues where my previous post titled Export events including Event Properties from Windows Event Viewer left off. The data I&#8217;m going to work with was exported using eventquery.vbs and saved in a CSV-file, comma separated file and it is presented in the form shown below. "Information","10","12.05.2009 13:24:48","Print","Servername","None","AD\username","Document 232, filename.pdf owned by username was [...]]]></description>
			<content:encoded><![CDATA[<p>This post continues where my previous post titled <a href="http://pario.no/2009/05/13/exporting-events-including-event-properties-from-windows-event-viewer/">Export events including Event Properties from Windows Event Viewer</a> left off.</p>
<p>The data I&#8217;m going to work with was exported using <strong>eventquery.vbs</strong> and saved in a CSV-file, comma separated file and it is presented in the form shown below.</p>
<pre>
"Information","10","12.05.2009 13:24:48","Print","Servername","None","AD\username","Document 232, filename.pdf owned by username was printed on printername via port IP_192.168.0.254. Size in bytes: 279232; pages printed: 18"</pre>
<p>I&#8217;m interested in the username, date/time printed and pages printed and will now show how I&#8217;ve accomplished that using some simple linux console commands.</p>
<pre>
awk -F, '{print $7 " " $3 " " $4 " " $NF}' Event_Viewer_System.csv | grep printername | awk '{print $1 "," $2 "," $3 "," $NF}' | sed 's/\"//g'|sort > PrintAccounting.csv</pre>
<p><strong>Result</strong></p>
<pre>
username,14.05.2009,12:58:41,18
username,15.05.2009,09:24:13,2
username,15.05.2009,09:25:00,37
username,15.05.2009,09:30:03,2
username,15.05.2009,09:30:29,2
...</pre>
<p>Where the fields contain username, date, time and the amount of printed pages.</p>
<p>A short description on whats being done</p>
<ul>
<li>print out column 7, 3, 4 and last column where the separator is a comma (,) from the file Event_Viewer_System.csv</li>
<li>filter out the printer you are interested in</li>
<li>filter out again the data we are interested in</li>
<li>remove quote sign (&#8220;) from the list</li>
<li>sort the list ny username</li>
<li>redirect the output to a file</li>
</ul>
<p>And that&#8217;s how you make a primitive print accounting system from data gathered in a Windows Server.<br />
This particular example has been testen on data from a Windows 2003 Server, but I think it can be performed on other versions of Windows as well.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMDUvMTUvc2ltcGxlLXdpbmRvd3MtcHJpbnQtYWNjb3VudGluZy11c2luZy1ldmVudC12aWV3ZXItZGF0YS88d3B0Yj5TaW1wbGUgV2luZG93cyBQcmludCBBY2NvdW50aW5nIHVzaW5nIEV2ZW50IFZpZXdlciBkYXRhPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/05/15/simple-windows-print-accounting-using-event-viewer-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exporting last name, first name and username from Active Directory using AdFind</title>
		<link>http://pario.no/2008/02/11/exporting-last-name-first-name-and-username-from-active-directory-using-adfind/</link>
		<comments>http://pario.no/2008/02/11/exporting-last-name-first-name-and-username-from-active-directory-using-adfind/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 10:25:48 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[adfind]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[export]]></category>

		<guid isPermaLink="false">http://pario.no/2008/02/11/exporting-last-name-first-name-and-usersname-from-active-directory/</guid>
		<description><![CDATA[AdFind is a Windows command line Active Directory query tool. It is a mixture of ldapsearch, search.vbs, ldp, dsquery, and dsget tools with a ton of other cool features thrown in for good measure. This post describes how I managed to export Last name (surname/sn) First name (givenName) Username (samaccountname) from a Active Directory and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.joeware.net/freetools/tools/adfind/">AdFind</a> is a Windows command line Active Directory query tool. It is a mixture of ldapsearch, search.vbs, ldp, dsquery, and dsget tools with a ton of other cool features thrown in for good measure.</p>
<p>This post describes how I managed to export</p>
<ul>
<li>Last name (surname/sn)</li>
<li>First name (givenName)</li>
<li>Username (samaccountname)</li>
</ul>
<p>from a Active Directory and save the result to a comma separated file (CSV)</p>
<pre>
adfind.exe -b ou=ActiveDirectory,dc=example,dc=com -f "objectClass=user" sn givenName  samaccountname -nodn -adcsv &gt; exported_users.csv</pre>
<p>The result of this command is as follows</p>
<pre>
"Last name","First name","username"</pre>
<p>This is a nicely formatted csv file that makes it easy to work with.</p>
<p><strong>What values are available and can be searched for in a Active Directory?</strong><br />
If you are uncertain on the name of what you are looking for, then this line comes handy</p>
<pre>
adfind.exe -b ou=ActiveDirectory,dc=example,dc=com -s subtree |more</pre>
<p><note><br />
Remember to use the | more at the end of the line because this command lists a lot of Active Directory content.</note><br />
The result of this command can contain some of the following values</p>
<pre>
cn, sb,giveNnAME,  distinguishedname, instanceType, whenCreated, whenChanged, displayName, uSNCreated, memberOf, uSNChanged, department, homeMTA, proxyAddresses, homeMBD, mDBUseDefaults, mailNickName, name, objectGUID, userAccountControl, badPwdCount, codePage, countryCode, homeDirectory, homeDrive, badPasswordTime, lastLogoff, lastLogon, logonHours, pwdLastSet, primaryGroupID, userParameters, profileParh, objectSid, accountExpires, logonCount, sAMAccountname, SamaccountType, showInAddressBook, msNPAllowDialoin, dSCorePropagationData, lastLogonTimestamp, textEncodeORAddress, mail, middleName, msExchaPoliciesExcluded, msExchHomeServerName, msExchALObjectVersion, msExchMailboxSecurityDescriptor, msExchUserAccountControl, msExchMailboxGuid</pre>
<p>The values above are usually assosiated with a useraccount.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/www.joeware.net\/freetools\/tools\/adfind\/"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDIvMTEvZXhwb3J0aW5nLWxhc3QtbmFtZS1maXJzdC1uYW1lLWFuZC11c2VybmFtZS1mcm9tLWFjdGl2ZS1kaXJlY3RvcnktdXNpbmctYWRmaW5kLzx3cHRiPkV4cG9ydGluZyBsYXN0IG5hbWUsIGZpcnN0IG5hbWUgYW5kIHVzZXJuYW1lIGZyb20gQWN0aXZlIERpcmVjdG9yeSB1c2luZyBBZEZpbmQ8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/02/11/exporting-last-name-first-name-and-username-from-active-directory-using-adfind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import csv data to mysql</title>
		<link>http://pario.no/2007/05/07/import-csv-data-to-mysql/</link>
		<comments>http://pario.no/2007/05/07/import-csv-data-to-mysql/#comments</comments>
		<pubDate>Mon, 07 May 2007 11:09:35 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/05/07/import-av-csv-data-til-mysql/</guid>
		<description><![CDATA[This is a short note about how to import comma separated data, CSV, from a file into a mysql database from a shell. Log in to your mysql database and choose the database you are going to import into. Type in the following in the mysql console to import from the CSV file load data [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short note about how to import comma separated data, CSV, from a file into a mysql database from a shell.</p>
<ol>
<li>Log in to your mysql database and choose the database you are going to import into.</li>
<li>Type in the following in the mysql console to import from the CSV file
<pre>
load data infile '/home/username/data.csv' into table program fields terminated by ';' lines terminated by '\r\n';</pre>
</li>
</ol>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDUvMDcvaW1wb3J0LWNzdi1kYXRhLXRvLW15c3FsLzx3cHRiPkltcG9ydCBjc3YgZGF0YSB0byBteXNxbDx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/05/07/import-csv-data-to-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comma separated list of system processes</title>
		<link>http://pario.no/2007/05/07/comma-separated-list-of-system-processes/</link>
		<comments>http://pario.no/2007/05/07/comma-separated-list-of-system-processes/#comments</comments>
		<pubDate>Mon, 07 May 2007 10:51:52 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[csv]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/05/07/komma-separert-liste-over-prosesser-pa-systemet/</guid>
		<description><![CDATA[Run this command from a console window ps axo "%u,%U,%p,%a,%z"]]></description>
			<content:encoded><![CDATA[<p>Run this command from a console window</p>
<pre>
ps axo "%u,%U,%p,%a,%z"</pre>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDUvMDcvY29tbWEtc2VwYXJhdGVkLWxpc3Qtb2Ytc3lzdGVtLXByb2Nlc3Nlcy88d3B0Yj5Db21tYSBzZXBhcmF0ZWQgbGlzdCBvZiBzeXN0ZW0gcHJvY2Vzc2VzPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/05/07/comma-separated-list-of-system-processes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MDB tools to export (migrate) from mdb (Microsoft Access format) to mySQL</title>
		<link>http://pario.no/2007/04/27/mdb-tools-to-export-migrate-from-mdb-microsoft-access-format-to-mysql/</link>
		<comments>http://pario.no/2007/04/27/mdb-tools-to-export-migrate-from-mdb-microsoft-access-format-to-mysql/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 13:41:57 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[phpMyAdmin]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/04/27/mdb-tools-to-export-migrate-from-mdb-microsoft-access-format-to-mysql/</guid>
		<description><![CDATA[This convertion could be obtained by first converting the tables in the mdb-file into CSV-files (Comma Separated Values) using MDB Tools and then by importing the csv-files into MySQL using phpMyAdmin. To export a given table from a mdb-file, we type: mdb-export db.mdb customers &#62;&#62; customers.csv In my case, since I got some danish characters, [...]]]></description>
			<content:encoded><![CDATA[<p>This convertion could be obtained by first converting the tables in the mdb-file into CSV-files (Comma Separated Values) using MDB Tools and then by importing the csv-files into MySQL using phpMyAdmin.</p>
<p>To export a given table from a mdb-file, we type:</p>
<p><code>mdb-export db.mdb customers &gt;&gt; customers.csv</code></p>
<p>In my case, since I got some danish characters, I need to force mdbtools to encode everything as ISO8859-1 instead of UTF-8, which is the default. This can be done by setting the environment variable MDB_ICONV to ISO8859-1</p>
<p><code>export MDB_ICONV="ISO8859-1"</code></p>
<p>The resulting CSV-files could be imported into MySQL using phpMyAdmin.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDQvMjcvbWRiLXRvb2xzLXRvLWV4cG9ydC1taWdyYXRlLWZyb20tbWRiLW1pY3Jvc29mdC1hY2Nlc3MtZm9ybWF0LXRvLW15c3FsLzx3cHRiPk1EQiB0b29scyB0byBleHBvcnQgKG1pZ3JhdGUpIGZyb20gbWRiIChNaWNyb3NvZnQgQWNjZXNzIGZvcm1hdCkgdG8gbXlTUUw8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/04/27/mdb-tools-to-export-migrate-from-mdb-microsoft-access-format-to-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

