catscan home page

catscan is a simple perl script that decodes output from the Digital Convergence CueCat Barcode Scanner. It reads the scanned input and converts it to numbers, indicating if the input is a UPC or ISBN number.

It was written by Andrew Stellman. You can find source at http://anon.razorwire.com/catscan/catscan.pl.

Please note the new URL for this page: http://anon.razorwire.com/catscan.

Send questions, comments or bugs to roo@razorwire.com.

Please note that catscan.pl is probably inferior to Larry Wall's very compact and efficient script:

#!/usr/bin/perl -n 
printf "Serial: %s  Type: %s  Code: %s\n", 
    map { 
        tr/a-zA-Z0-9+-/ -_/; 
        $_ = unpack 'u', chr(32 + length()*3/4) . $_; 
        s/\0+$//; 
        $_ ^= "C" x length; 
    } /\.([^.]+)/g; 
For more information about CueCat scanners, go to the CueCat Resources page.

Header from the catscan.pl:


# catscan.pl 1.1 -- by Andrew Stellman 
#
# Quick and dirty script to deocode cuecat barcode scans
# 
#
# Released under the GPL. 
#
# From http://uscan.sourceforge.net/upc.txt:
#
# divide the UPC into 4 groups of three digits
# use the scheme below to translate each digit into its output
# 
#     1  2  3
# 
# 0   C3 n  Z  
# 1   CN j  Y  
# 2   Cx f  X  
# 3   Ch b  W  
# 4   D3 D  3  
# 5   DN z  2  
# 6   Dx v  1  
# 7   Dh r  0  
# 8   E3 T  7  
# 9   EN P  6 
#
# See http://www.jounce.net/~maarken/ for more details about the encoding
# scheme used and for more source.
#
# Thanks to Christopher R. Curzio 
# for identifying the UPC-E1 barcode type!
#
# Revision history:
# 09/06/00 - Version 1.1: Added UPC-E1 type barcode and fixed bug that
#            caused it to drop the last one or two characters for any
#            barcode whose length was not divisible by 3.
# 08/23/00 - Version 1.0



powered by software from Stellman & Greene.