<?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>chown-R</title>
	<atom:link href="http://www.chown-r.com/press/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.chown-r.com/press</link>
	<description>Warehouse Logistics</description>
	<lastBuildDate>Mon, 14 May 2012 23:18:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Switching to pfSense</title>
		<link>http://www.chown-r.com/press/?p=397</link>
		<comments>http://www.chown-r.com/press/?p=397#comments</comments>
		<pubDate>Mon, 14 May 2012 23:18:12 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[clearos]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[pfsense]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=397</guid>
		<description><![CDATA[I&#8217;m switching the main firewall at the warehouse over to pfSense this week.  I was using ClearOS (and may still switch back), but I really don&#8217;t use many of the features &#8212; actually just the mail server &#8212; so it&#8217;s a little overkill.  And they&#8217;re changing versions again.  The newest version just released is switching [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m switching the main firewall at the warehouse over to <a href="http://www.pfsense.org/">pfSense</a> this week.  I was using ClearOS (and may still switch back), but I really don&#8217;t use many of the features &#8212; actually just the mail server &#8212; so it&#8217;s a little overkill.  And they&#8217;re changing versions again.  The <a href="http://www.clearfoundation.com/Software/downloads.html">newest version</a> just released is switching to a marketplace for all the apps (most of which are free) but it&#8217;s a little confusing and doesn&#8217;t quite work right yet.  And as the office is still having issues uploading to my web server I&#8217;m hoping this switch will fix it.</p>
<p>pfSense works great on the test box I made.  I need to get used to the layout, though.  The menus aren&#8217;t grouped the way I would expect.  For example, the System menu doesn&#8217;t have Shutdown / Reboot.  Instead, Shutdown is listed as Halt in the Diagnostic menu and Reboot is listed several entries below.   The menus are alphabetical and not grouped by task.</p>
<p>The only major complaint that I have is in the buttons Add, Edit, Delete, and Move.   They really should just have used the words instead.  I know the button with the plus symbol means &#8220;Add&#8221; but I still have to mouseover to make sure that&#8217;s what it does.  Also, they&#8217;re clumped together in a bunch so it&#8217;s very easy to miss and hit the wrong one.  At least for me, I&#8217;m clumsy.</p>
<p>It is very powerful (and somewhat daunting in parts &#8212; Traffic Shaping, for example) and once I find a replacement for the ClearOS mailserver I&#8217;m going to swap boxes and see what breaks.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=397</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PerlTk, Hiding the Button</title>
		<link>http://www.chown-r.com/press/?p=394</link>
		<comments>http://www.chown-r.com/press/?p=394#comments</comments>
		<pubDate>Thu, 12 Apr 2012 22:58:37 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[hidden]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perltk]]></category>
		<category><![CDATA[visible]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=394</guid>
		<description><![CDATA[I&#8217;m working on some PerlTk code, and I need to hide a &#8220;Print&#8221; button until the transaction is complete.  There&#8217;s no option for hiding a button other than packForget() or gridForget(), but both of those can mess up the flow because (although they leave a placeholder) they remove the object from the layout causing it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on some PerlTk code, and I need to hide a &#8220;Print&#8221; button until the transaction is complete.  There&#8217;s no option for hiding a button other than packForget() or gridForget(), but both of those can mess up the flow because (although they leave a placeholder) they remove the object from the layout causing it to reflow.</p>
<p>I hacked around and came up with this:</p>
<pre>my $button1 = $mw-&gt;Button(-text=&gt;"One",-command=&gt;\&amp;toggle_button)-&gt;grid(-row=&gt;0,-column=&gt;0);
my $button2 = $mw-&gt;Button(-text=&gt;"Two",-command=&gt;\&amp;print_report)-&gt;grid(-row=&gt;0,-column=&gt;1);

$blank = $mw-&gt;Label(-text=&gt;" ")-&gt;grid(-row=&gt;0,-column=&gt;1,-sticky=&gt;"nsew");

sub toggle_button() {
  if ($blank-&gt;ismapped) {
    $blank-&gt;gridForget();
  }
  else {
    $blank-&gt;grid(-row=&gt;0,-column=&gt;1,-sticky=&gt;"nsew");
  }
}</pre>
<p>The Label covers the button so it&#8217;s hidden and can&#8217;t be clicked.  And I can gridForget() it without the whole screen reflowing.  The only downside is the row and column need to be fixed, so I don&#8217;t know if this would work with pack.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=394</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dropbox and SQLite3</title>
		<link>http://www.chown-r.com/press/?p=391</link>
		<comments>http://www.chown-r.com/press/?p=391#comments</comments>
		<pubDate>Wed, 11 Apr 2012 21:54:32 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[sqlite3]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=391</guid>
		<description><![CDATA[Today I learned that multiple inserts to a SQLite database in a Dropbox folder is a bad idea.  Each insert is a write, and after each write Dropbox locks and syncs the .db so the next insert is delayed&#8230; I was averaging a second for every two inserts!]]></description>
			<content:encoded><![CDATA[<p>Today I learned that multiple inserts to a SQLite database in a Dropbox folder is a bad idea.  Each insert is a write, and after each write Dropbox locks and syncs the .db so the next insert is delayed&#8230; I was averaging a second for every two inserts!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=391</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu and Firefox</title>
		<link>http://www.chown-r.com/press/?p=387</link>
		<comments>http://www.chown-r.com/press/?p=387#comments</comments>
		<pubDate>Tue, 28 Feb 2012 12:17:32 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[userchrome.css]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=387</guid>
		<description><![CDATA[Ubuntu has pushed Firefox 10 out to the LTS versions (10.04).   It showed up in last months updates.   There&#8217;s only a few small problems. For some reason, the folder icons in Bookmarks don&#8217;t show up.    Also, there&#8217;s no way to remove &#8220;Unsorted Bookmarks&#8221; from the bookmark menu.  Both can be fixed by editing /home/USER/.mozilla/firefox/PROFILE.default/chrome/userChrome.css (make [...]]]></description>
			<content:encoded><![CDATA[<p>Ubuntu has pushed Firefox 10 out to the LTS versions (10.04).   It showed up in last months updates.   There&#8217;s only a few small problems.</p>
<p>For some reason, the folder icons in Bookmarks don&#8217;t show up.    Also, there&#8217;s no way to remove &#8220;Unsorted Bookmarks&#8221; from the bookmark menu.  Both can be fixed by editing</p>
<pre>/home/USER/.mozilla/firefox/PROFILE.default/chrome/userChrome.css</pre>
<p>(make one if you don&#8217;t have one, you&#8217;ll need it eventually).  Add this code, the top part fixes the missing folder icons (found on <a href="http://www.fedoraforum.org/forum/showthread.php?t=259976" target="_blank">Fedoraforum.org</a>), the bottom part removes the &#8220;Unsorted Bookmarks&#8221; (found on <a href="http://blog.ffextensionguru.com/2011/07/11/remove-unsorted-bookmarks-item/" target="_blank">ffextensionguru.com</a>)</p>
<pre>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
menu.bookmark-item &gt; .menu-iconic-left {
visibility: visible;
}
#menu_unsortedBookmarks,
#bookmarksMenuPopup &gt; menuseparator[builder="end"]
{display:none!important;}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=387</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Worldship Batch Import</title>
		<link>http://www.chown-r.com/press/?p=384</link>
		<comments>http://www.chown-r.com/press/?p=384#comments</comments>
		<pubDate>Wed, 08 Feb 2012 14:07:33 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[single-quote]]></category>
		<category><![CDATA[worldship]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=384</guid>
		<description><![CDATA[I found out this morning that a single-quote in someone&#8217;s name will cause a batch import to crash UPS Worldship with an illegal database operation.  I&#8217;ve mentioned before that Worldship doesn&#8217;t like double-hyphens (http://www.chown-r.com/press/?p=359) but now it seems I have to scrub everything that&#8217;s not alphanum to make sure it&#8217;ll make it through the batch [...]]]></description>
			<content:encoded><![CDATA[<p>I found out this morning that a single-quote in someone&#8217;s name will cause a batch import to crash UPS Worldship with an illegal database operation.  I&#8217;ve mentioned before that Worldship doesn&#8217;t like double-hyphens (http://www.chown-r.com/press/?p=359) but now it seems I have to scrub everything that&#8217;s not alphanum to make sure it&#8217;ll make it through the batch import.  I sent UPS an email with the details so it should get some kind of attention.</p>
<p>On a side note, I hate how some programs (OpenOffice) save .csv files as tab separated.  &#8220;C&#8221; in CSV stands for COMMA.  As in &#8220;comma separated values&#8221;  Make your own format (.tsv) if you want, but stop trying to push everything to tabs!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=384</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Old Ubuntu Still Lives!</title>
		<link>http://www.chown-r.com/press/?p=377</link>
		<comments>http://www.chown-r.com/press/?p=377#comments</comments>
		<pubDate>Fri, 16 Dec 2011 12:26:57 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sources.list]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=377</guid>
		<description><![CDATA[I&#8217;m building an old Karmic box from scratch ( I need PHP 5.2 ) but the original /etc/apt/sources.list is broken now that Karmic has reached end of life. sed s/us\.archive/old-releases/g sources.list &#62; new_sources.list Then just replace the original sources.list with the new one.  That should get updates working again.  You can also do sed s/security\.ubuntu/old-releases\.ubuntu/g [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building an old Karmic box from scratch ( I need PHP 5.2 ) but the original</p>
<pre>/etc/apt/sources.list</pre>
<p>is broken now that Karmic has reached end of life.</p>
<pre>sed s/us\.archive/old-releases/g sources.list &gt; new_sources.list</pre>
<p>Then just replace the original sources.list with the new one.  That should get updates working again.  You can also do</p>
<pre>sed s/security\.ubuntu/old-releases\.ubuntu/g sources.list &gt; new_sources.list</pre>
<p>but most everything in security is held back by default so apt-get upgrade won&#8217;t work.  You&#8217;ll need to force and upgrade using apt-get install $package_name.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=377</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu and Intel</title>
		<link>http://www.chown-r.com/press/?p=373</link>
		<comments>http://www.chown-r.com/press/?p=373#comments</comments>
		<pubDate>Fri, 18 Nov 2011 13:04:20 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[i910]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vesa]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=373</guid>
		<description><![CDATA[I&#8217;ve got a stack of older Compaq Evo desktops that came over from the office when they upgraded last year.  Most of them are still running Windows XP, but some I&#8217;ve been switching over to Ubuntu 10.04 to use as EDI scanning stations (CUPS works better with the printing in my setup).  The problem: Intel. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a stack of older Compaq Evo desktops that came over from the office when they upgraded last year.  Most of them are still running Windows XP, but some I&#8217;ve been switching over to Ubuntu 10.04 to use as EDI scanning stations (CUPS works better with the printing in my setup).  The problem: Intel.</p>
<p>The computers all have built in Intel 82845G/GL [Brookdale-G] graphics.  And every so often (when my USB barcode scanner is plugged in) X and GDM lock up in an infinite black screen &#8211; to &#8211; pinstripe loop.   The only recourse is to shutdown the system.  None of the virtual terminals (CTL-ALT-F1 through F7) respond which seems kind of odd.  Anyway, it&#8217;s a <a href="https://bugs.launchpad.net/ubuntu/lucid/+source/xserver-xorg-video-intel/+bug/541492">known bug</a> for older Ubuntus.  I&#8217;ve tried every <a href="https://wiki.ubuntu.com/X/Bugs/Lucidi8xxFreezes">work around</a> posted but none seem to work.  Switching to KMS mode made it crash the whole system instead of just X.  So I&#8217;m giving up in the Intel driver.</p>
<p>Start by rebooting the system and holding down SHIFT to get the GRUB2 menu to come up.  Then choose recovery mode (probably the second line down).   Select root shell from the old-school menu and run</p>
<pre># Xorg -configure</pre>
<p>to get a base xorg.conf file.  Copy it to /etc/X11/xorg.conf (assuming you don&#8217;t already have one or backed up the current one) and open it in vim.  One of the work-arounds is to add</p>
<pre>Option "Shadow" "False"</pre>
<p>and</p>
<pre>Option "DRI" "False"</pre>
<p>to the Device section.  But there is no Shadow option in the current i910 driver and DRI didn&#8217;t seem to matter which way it was set.  Instead,  change the driver line:</p>
<pre>Driver "intel"</pre>
<p>to</p>
<pre>Driver "vesa"</pre>
<p>The system&#8217;s been running now for several days and so far no pinstripe screen crashes.  The graphics look just as good as they did with the Intel driver.  The only change I had to make was adjusting the resolution back down to 1024 x 768.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=373</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DHCP and Broadcast IP</title>
		<link>http://www.chown-r.com/press/?p=369</link>
		<comments>http://www.chown-r.com/press/?p=369#comments</comments>
		<pubDate>Mon, 14 Nov 2011 19:52:59 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[clearos]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[dnsmasq]]></category>
		<category><![CDATA[etherape]]></category>
		<category><![CDATA[firewall]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=369</guid>
		<description><![CDATA[I&#8217;ve just found out that my network at the warehouse is somewhat broken and has been for quite a while.  I&#8217;m running a ClearOS firewall as a DHCP server configured in the 192.168.1.1 &#8211; 192.168.1.255 range.  When I first set up the firewall I used the development IP range 192.168.5.1 &#8211; 192.168.5.255 for testing.  Evidently, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just found out that my network at the warehouse is somewhat broken and has been for quite a while.  I&#8217;m running a <a href="http://www.clearfoundation.com/">ClearOS</a> firewall as a DHCP server configured in the 192.168.1.1 &#8211; 192.168.1.255 range.  When I first set up the firewall I used the development IP range 192.168.5.1 &#8211; 192.168.5.255 for testing.  Evidently, when I moved it from testing to production the <a href="http://en.wikipedia.org/wiki/Broadcast_address">broadcast IP address</a> didn&#8217;t get changed to match the new IP range.  It&#8217;s stuck handing out the broadcast address as 192.168.5.255.</p>
<p>There&#8217;s no way to change that in the ClearOS webadmin tool, so I ran a backup and then adjusted /etc/dnsmasq/dhcp.conf with the right IP address.  Unfortunately, dnsmasq loves caching so I have to reboot the firewall tonight to get it to notice the new config file (I tried &#8220;kill -HUP dnsmasq-PID&#8221;, but that doesn&#8217;t re-read dhcp.conf).</p>
<p>The main thing I&#8217;ve noticed is that most of the computers don&#8217;t care that the broadcast address is outside the netmask range.  I&#8217;m not sure if the systems are correcting it automatically or just using it broken.  But everything still seems to work (or I don&#8217;t notice any bad traffic).</p>
<p><a href="http://etherape.sourceforge.net">EtherApe</a> is a great tool for seeing where the traffic is going.  That&#8217;s how I noticed some of the computers pinging the wrong address which I though was just a rouge test machine pushing packets out the wrong interface.</p>
<p>Sidenote: I&#8217;d file a bug with ClearOS, but they don&#8217;t make it easy.  I have to sign up as a developer first to get permission to file bug reports.  I think I&#8217;ll just post it in the forums and see if it gets picked up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=369</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing EasyONIX</title>
		<link>http://www.chown-r.com/press/?p=365</link>
		<comments>http://www.chown-r.com/press/?p=365#comments</comments>
		<pubDate>Mon, 24 Oct 2011 17:57:04 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[easyonix]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=365</guid>
		<description><![CDATA[The marketing department needs to run off some reports in Onix (a fancy XML format) so I set up a server running EasyONIX for them on an old XP machine.  It takes a little bit of hammering to get it up and running. It can use IIS or Apache to run the web based front [...]]]></description>
			<content:encoded><![CDATA[<p>The marketing department needs to run off some reports in Onix (a fancy XML format) so I set up a server running <a href="http://www.easyonix.com/">EasyONIX</a> for them on an old XP machine.  It takes a little bit of hammering to get it up and running. It can use IIS or Apache to run the web based front end, but it needs Windows to run the EasyONIX server.</p>
<ul>
<li>Install Apache 2</li>
<li>Install EasyONIX</li>
<li>Move C:\Program Files\EasyONIX to C:\Program Files\old_EasyONIX</li>
<li>Unpack the update and move it to C:\Program Files\EasyONIX</li>
<li>Edit C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf</li>
<li>Restart Apache</li>
<li>Launch EasyONIX server</li>
<li>Browse to http://localhost/easyonix/index.htm</li>
</ul>
<p>The only trouble part is updating httpd.conf with the right settings.  There&#8217;s several lines that need to be added to the default config.  The first two lines need to be added to the correct section:</p>
<pre>&lt;ifModule alias_module&gt;
 Alias /easyonix/ "C:/Program Files/EasyONIX/"
&lt;ifModule&gt;</pre>
<pre>&lt;ifModule mime_module&gt;
 AddHandler cgi-script .exe
&lt;ifModule&gt;</pre>
<p>The last part is the main folder permissions:</p>
<pre>&lt;Directory "C:/Program Files/EasyONIX/"&gt;
 Options Indexes Multiviews ExecCGI
 AllowOverride None
 Order allow,deny
 Allow from all
&lt;/Directory&gt;</pre>
<p>The mapping looks pretty easy although I haven&#8217;t tried any test data yet.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=365</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel Spreadsheet for Worldship</title>
		<link>http://www.chown-r.com/press/?p=359</link>
		<comments>http://www.chown-r.com/press/?p=359#comments</comments>
		<pubDate>Sun, 02 Oct 2011 01:25:16 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Warehouse]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.chown-r.com/press/?p=359</guid>
		<description><![CDATA[We&#8217;ve been doing a lot of promo mailings for the marketing department.  They&#8217;re giving me an Excel spreadsheet of addresses and I&#8217;ve been converting them into CSV format to hand to UPS Worldship to process as a batch job. There&#8217;s several problems: UPS expects columns to be in the correct order (and the right number [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been doing a lot of promo mailings for the marketing department.  They&#8217;re giving me an Excel spreadsheet of addresses and I&#8217;ve been converting them into CSV format to hand to UPS Worldship to process as a batch job. There&#8217;s several problems:</p>
<ul>
<li>UPS expects columns to be in the correct order (and the right number of them)</li>
<li>UPS hates UTF8 (specifically &#8220;&#8211;&#8221; \x2014)</li>
<li>There&#8217;s PO Boxes scattered throughout.  And UPS doesn&#8217;t do PO Boxes.</li>
</ul>
<p>So I wrote up a Perl script this week to handle the conversion from now on.  CPAN has a <a href="http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.59/lib/Spreadsheet/ParseExcel.pm">Spreadsheet::ParseExcel</a> that can read Excel data, and writing CSV is pretty trivial.  The hard part is getting the columns in the right order.</p>
<p>First, I scan through row 0 (the header row) and try to find the columns I need:</p>
<pre># Try to match actual header with desired header
my $count = -1;
SWITCH:
foreach (@header) {
++$count;
/customer/i   &amp;&amp; do { $link_header{'Customer_ID'} = $count; next SWITCH;} ;
/outlet/i     &amp;&amp; do { $link_header{'Outlet'}      = $count; next SWITCH;} ;
/first/i      &amp;&amp; do { $link_header{'First_Name'}  = $count; next SWITCH;} ;
/last/i       &amp;&amp; do { $link_header{'Last_Name'}   = $count; next SWITCH;} ;
/title/i      &amp;&amp; do { $link_header{'Title'}       = $count; next SWITCH;} ;
/address.+1/i &amp;&amp; do { $link_header{'Address_1'}   = $count; next SWITCH;} ;
/address.+2/i &amp;&amp; do { $link_header{'Address_2'}   = $count; next SWITCH;} ;
/city/i       &amp;&amp; do { $link_header{'City'}        = $count; next SWITCH;} ;
/state/i      &amp;&amp; do { $link_header{'State'}       = $count; next SWITCH;} ;
/postal/i     &amp;&amp; do { $link_header{'Postal_Code'} = $count; next SWITCH;} ;
/weight/i     &amp;&amp; do { $link_header{'Weight'}      = $count; next SWITCH;} ;
/department/i &amp;&amp; do { $link_header{'Department'}  = $count; next SWITCH;} ;
}
# if none of the fields match, there's no point to going on
die "No Header Row\n" unless scalar(keys %link_header) &gt; 1;</pre>
<p>Then, swap the keys with the values so I can look up the values later</p>
<pre>my %reverse_header = reverse %link_header;</pre>
<p>Then scan through the spreadsheet and try to match the column I&#8217;m reading with a header I want:</p>
<pre>for my $row (1 .. $row_max) {
 for my $col (0 .. $col_max) {
   my $cell = $worksheet-&gt;get_cell( $row,$col);
   next unless ($cell);
   my $data = $cell-&gt;value();
  # if the column of $data is in headers, save the $data.
   if (exists $reverse_header{$col} ) {
      my $keys = $reverse_header{$col};
   ...
   $temp{$keys} = $data;
}</pre>
<p>Then filter out the PO Boxes and the UTF8 stuff and write it out to a CSV. It makes life much easier!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chown-r.com/press/?feed=rss2&#038;p=359</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

