Well, if you are typing a list you may want to explore the world of maps... Or simply use a script such as: http://kolmafia.us/index.php/topic,1282.msg6263.html#msg6263
Ok, so it turns out it doesn't have a sell function, but try this:
string filename = "itemlist.txt";
item [string, int]...