At the suggestion of Chris at Drivewerks I'm posting the Perl script below that I use to process Drivewerk's ACCESSORIES (NOT CAR PARTS) datafeed.

Words to the wise:
1. I make no warantee on this script though it works for me. Nor do I support it. It's up to y'all to make whatever changes you want.
2. The script accepts Drivewerks tab-delimited file as stdin & outputs a pipe-delimited file as stdout. I use the output in conjuction with the MySQL LOAD command.
3. The script takes an optinal -l flag indicating the maximum price for an item. By default that's $20.00.
4. The output is for my database. So there are some extra fields you may not need, want.
5. I use the Driverwerks breadcrumb field for my categories and sub-categories (I like them better). The script shows how I process that field.

Ok with this in mind here you go:
#!perl

#-------------------------------------------------------------------------------
# This script is free for use by anyone. No guarantees come with it.
# Author: Mike West
#
# Read and process the DriveWerks Car accessories datafeed.
# To run: assumeing this script is marked as executable:
# [path]driverwerks_acc.pl -l 50 < input > output
# otherwise:
# [path]perl [path]drivewerks_acc.pl -l 50 < input > output
# where the -l indicates largest price item we want to process ($20.00 by default)
# input is the name of the datafeed and output is an output file.
#
# output is pipe delimited and suitable for the MySQL LOAD command.
#-------------------------------------------------------------------------------

# -- read the Drivewerks tab delimited datafeed
require 'getopts.pl';

&Getopts('l:');

# get the max. price from the -l command line entry if specified.
if(length($opt_l) == 0) {
print (STDERR "No limit specified, using default of 20\n");
$limit = 20;
}
else {
$limit = $opt_l;
}

$i=0;
while($item=<&gt {
next if($i++ == 0); # skip the 1st line, it's a header

# get rid of the ASCII 95 chracters
$item =~ s/\225//g;

@fields = split(/\011/,$item);

# some of the feeds have missing, bogus data so we reject anything that doesnt' have exactly 12 delimited fields (plus one for the newline character)
$field_count = @fields;
next if($field_count != 13);

# and reject any items over our max. price limit
$price = $fields[3];
next if $price > $limit;

$record_number = $fields[0];
$part_number = $fields[1];
$title = $fields[2];
$msrp = $fields[4];
$time_to_ship = $fields[5];
$image_url = $fields[6];
$category = $fileds[7];
$link = $fields[8];
$section = $fields[9];
$sdesc = $fields[10];

# we use the breadcrumb field (#11) to establish our categories
@breadcrumbs = split(/ > /,$fields[11]);

# we use the breadcrumb field to determine our category with the 1st field being the category and the 3rd (2nd if not present) field being the subcategory.
$ourcategory = $breadcrumbs[0];
$oursubcategory = length($breadcrumbs[2])>0 ? $breadcrumbs[2] : $breadcrumbs[1];

printf("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\n",
$ourcategory, # our category
$oursubcategory, # our subcategory
"DRIVEWERKS", # our source
$link, # our link with sku appended
" ", # product sku
$title, # product name
" ", # prod. short name
" ", # brand_name
" ", # mfg
$part_number, # part no
" ", # model no.
" ", # dimensions
$category, # category
"", # sub-category (we want NULLs)
$price, # price, 2 dec. places
$msrp, # msrp, 2 dec. places
" ", # materials
" ", # origin
" ", # department
" ", # quality
" ", # warantee
"0", # on hand
" ", # upc code
"", # timage, NULLs
$image_url, # large image
$sdesc, # short desc.
" " # long desc.
);
} # end of drivewerks_acc.pl

www.swapsheet.com