Banish quotation marks from text files exported from Excel

When exporting Excel worksheets to CSV (comma-separated values) or tab-delimited text, it will add quotation marks (“..”) around any fields containing commas or quotes.

While such files can be re-imported into Excel without problems, it can cause other applications to choke. It is possible to open the files in a text editor to remove the problematic characters, or create a Word macro to do the same job automatically, but the simplest solution is to bypass Excel’s own file export filters and use a macro such as the following to perform the export:

Public Sub TextNoModification()
Const DELIMITER As String = "," 'or "|", vbTab, etc.
Dim myRecord As Range
Dim myField As Range
Dim nFileNum As Long
Dim sOut As String

nFileNum = FreeFile
Open "Test.txt" For Output As #nFileNum
For Each myRecord In Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells(1), _
Cells(.Row, Columns.Count).End(xlToLeft))
sOut = sOut & DELIMITER & myField.Text
Next myField
Print #nFileNum, Mid(sOut, 2)
sOut = Empty
End With
Next myRecord
Close #nFileNum
End Sub

The delimiter and output filename can be changed by editing the code. The macro above is taken from this very useful page from McGimpsey & Associates which contains a whole host of Excel tips.

Disabling NOD32 update balloons

I’m currently using NOD32 Antivirus (best of breed, according to Virus Bulletin) and the one complaint I have about it is the balloon tip that pops up every time the virus definitions update. It’s much better than having a window pop up and interrupt whatever I’m doing, but it’s still a little distracting.

Fortunately, there’s an easy way to turn it off – simply double-click the NOD32 icon in your system tray, choose NOD32 System Setup (under NOD32 System Tools), click the Setup button and tick Enable silent mode. You’ll still get warning messages when a virus is detected unless you’ve explicitly turned them off, but if you want to be extra sure, you can set up notifications via email and/or Messenger Service* popups through the Notification tab. If you’d like to safely simulate a virus infection, you can download the EICAR standard antivirus test file.

While I’m very happy with NOD32, it’s not the most memory-conservative antivirus solution out there. It uses around 20MB of RAM on my machine (with unnecessary features such as Office document protection, Outlook email protection and “Internet protection”, as well as the custom user interface, disabled), which is still better than a lot of the AV packages aimed at the home user, but still bloated compared to F-Prot which uses around a fifth of that. Having said that, as long as you’re running with more than 512MB of RAM, 20MB is a small price to pay for peace of mind.

* Note that the Messenger Service is nothing to do with MSN Messenger or Windows Messenger.

Getting NuSOAP to work in PHP5

I’ve been playing with NuSOAP (a SOAP toolkit for PHP) and had trouble getting it working under PHP5. I was getting the following error:

Fatal error: Cannot redeclare class soapclient in C:\Program Files\xampp\htdocs\dev\lib\nusoap.php on line 7240

It turns out that PHP5’s own SOAP extension uses soapclient as a class name. The easy solution is to replace all instances of soapclient in the NuSOAP library files (and your own code) with something else – I chose nusoapclient. If you use Notepad++, it’s as simple as opening all 13 source files and running a search/replace.

All the symbols you’re ever likely to need

I stumbled across the Code2000 font while typing up some revision notes which required “outline brackets” (Unicode characters 27E6 and 27E7). None of the the fonts on my computer seemed to include the symbols I needed.

If you’re ever in a similar position, you can download the font from James Kass. It includes most Unicode characters, so chances are that if a symbol exists, you’ll find it. It’s a TrueType font, which means it should work on Windows, Mac OS X and Linux.

Code2000 is a shareware product, which means that if you like it, you should pay the registration fee (currently $5 which works out as around £2.90) – a bargain, methinks.

Banish spam from your blog

Akismet is free plugin which provides intelligent spam-blocking for WordPress users. Since I installed it 15 days ago,  it has successfully blocked 60 spam comments.

It’s installed by default for users of WordPress.com but if, like me, you host your own blog, it’s easy to download and install the plugin, although you’ll need to sign up for a free WordPress.com account to receive the required API key.

Why I don’t recommend the Belkin OmniView E-Series 4-port KVM

no-kvm.png

I have acquired a new machine which I’m currently using for Linux (Ubuntu) experimentation, bringing my total up to three, so I decided to replace my old 2-port KVM (a cheap one from Ebuyer) with a 4-port Belkin model from Aria.

It came to just over £33 for the Belkin OmniView E-Series KVM (Belkin part number F1DB104P) and four sets of 1.8m cables (part number F3X1105B) – not exactly expensive, but nevertheless I expected it to work properly, especially with the Belkin name.

I connected up my primary system and immediately noticed visible ghosting/shadowing, similar to what I would expect from using unshielded cables. I was surprised as the cables seemed fairly thick and weighed a lot more than the cables which were bundled with my old 2-port. I’m using a Samsung SyncMaster 173s (17″ TFT) running at 1280×1024 pixels with 32-bit colour and a 60Hz refresh rate, driven by a GeForce 5200 card. Interestingly, the ghosting was less noticeable when using a VGA adaptor on the DVI port instead of the VGA port directly, but it was still there.

Belkin have cunningly used a non-standard cable design – whereas all KVMs I have seen use male PS/2 and VGA connectors on both ends, Belkin KVMs require male PS/2s on either end, a male VGA on one end and a female on the other. This makes it difficult to use non-Belkin cables as neither standard male-male KVM cables (as supplied with my previous KVM) nor male-female KVM extension cables can be substituted.

Out of curiosity, I took the KVM out of the equation and used one of the cables as a monitor extension, plugging the male end into my graphics card and the female end into my monitor’s VGA plug. The ghosting still happens, and reading around suggests that the cables aren’t suitable for resolutions above 1024×768 – indeed, lowering my resolution causes the ghosting to disappear, but this is hardly an acceptable solution.

I have considered returning the KVM and cables to Aria, but their online system refuses to issue an RMA for the KVM until I call their 60p/minute technical support line first, and insists that I must contact Belkin in order to return the cables. On top of that, there is a £2.99 testing fee and £6.95 return postage payable per item should they fail to identify a fault, plus the cost of me sending the item to Aria. So it’s not really worth returning the item for the sake of £33, but I’ll certainly learn from this experience and use an alternative supplier in future.

I have ordered both a VGA gender changer (so I can use my old KVM cables) and an SVGA extension cable (instead of the Belkin male-female cable) to see what works best and whether I’m able to solve the problem myself. The two came to just under £7 from Redfish Computing, a company I found through eBay. I won’t recommend them or otherwise until I’ve received the goods (or otherwise!)

Even if I’m able to solve the ghosting, there are still a couple of annoyances with the unit itself. The beep it makes when switching displays as horrible – much louder than my old KVM – and, more seriously, the mouse goes mad when switching from my Windows machine to my Ubuntu box. I haven’t tested my old KVM on this particular Linux machine, so can’t say if it’s only the Belkin’s fault, but I will experiment later. A couple of things you can try is editing /etc/modules (sudo vi /etc/modules) and changing the psmouse line to:

psmouse=imps

or

psmouse=exps

I haven’t been able to get this working 100% yet – sometimes the mouse still loses control when switching, but I am able to use the keyboard to switch to and log in to a text-only session (Ctrl+Alt+F1) then type the following:

sudo modprobe -r psmouse
sudo modprobe -a psmouse

I can then switch back to the graphical X session (Ctrl+Alt+F7) and the mouse works perfectly, until next time I switch.

I’ll keep experimenting and update this post with my findings, but for now I commend you to think very carefully before purchasing from Aria or Belkin.

Update: I haven’t tried this yet, but according to the fantastic SayNoTo0870 website, it may be possible to reach the Aria technical support team via an 0870 or non-geographical landline number as an alternative to the extortionate 0906 number listed on the website.

Update 2: To make it slightly quicker to fix the mouse in Ubuntu, I’ve created a shell script which runs modprobe whenever I type fixmouse. To make your own, type sudo vi /usr/bin/fixmouse and enter the following lines (press ‘i’ first to enter insert mode):

#!/bin/sh
sudo modprobe -r psmouse
sudo modprobe -a psmouse

Then hit Esc, then ‘w’, then ‘q’ to save your changes and quit the editor. Unfortunately you’ll still have to enter your password unless you have sudo’ed recently or are running in an interactive sudo session.

Update 3: I received my VGA extension and gender changer from Redfish promptly, however the new cable exhibited the same ghosting, as did my old KVM cables and a good-quality shielded VGA cable, although in the latter case it could have been the gender changer that was introducing problems. I’ll try another graphics card in my main PC and see if that solves the problem – I suspect it will, as other computers I’ve tried seem not to exhibit the ghosting issue.

I also noticed that the cables Aria recommended were not the same as Belkin recommend on the box, but that’s probably by the by.

In hindsight, although I’d still hesitate to recommend the Belkin, it’s not a bad unit for the price I paid. However, it is still unlikely that I will be purchasing with Aria again, because their premium-rate support line and over-complicated RMA policy is unacceptable in my eyes.

Update 4: I replaced the FX 5200 card with an ATI Radeon 9250, and the ghosting problem has disappeared. Unfortunately, I’m still getting some noticeable artifacts when I’m using my main machine and one of my other machines (with a Radeon 7500 card) is powered on, but at least it’s more acceptable than constant ghosting.