Merchant product feeds are a great way to add a load of products to your affiliate website quickly. If you’re using something like Affilistore you can knock up a money-earning website in no time at all. The trouble with feeds is that they tend to be all or nothing and as we all know our affiliate sites need to be niche-focused. Getting the products you need out of a feed can be helped a great deal by the command line tools which come built in to Macs and Linux.
Geek alert! This is one way of achieving the task which makes sense to a geek like me. It’s not for everyone. If you are scared of typing commands and want a point and click approach this one isn’t for you.
First thing, you need to get to the command line. On Macs this is done by running the Terminal app which you will find in the Applications / Utilities. Different versions of Linux work in different ways but you’re looking for something called terminal or shell which will probably be in a ’system’ or ‘utilities’ menu.
Next you need to find your way to an easy to use directory. You should be able to do this by typing :
cd Desktop
if you type :
ls
at this point you should see a listing of the files you have on your desktop.
Download your product feed from the affiliate network website onto your desktop. We’ll assume that it’s called feed.csv. We need to extract the first line of the file, which has all the column names in it and place it into our output file. This we do by typing:
head -n 1 feed.csv > output.csv
Then we want to search through the feed file and extract every product which matches our search text. Say we want to find all the Bob the Builder products, we type:
grep -i "bob the builder" feed.csv >> output.csv
Notice the -i option which means we are doing a case-insensitive search and the double > means we are adding to the existing file not overwriting it.
And that’s about it. If you searched for a more generic term you might need to open the CSV file in a spreadsheet programme and edit the results a bit.
This may all seem geeky but it’s very effective and very fast. I just cut a 330 meg feed file down to just 14k in less than a minute using this technique. A 14k file I can finetune by hand; a 330 meg file is a non-starter.